MCPcopy Create free account
hub / github.com/error311/FileRise / syncActiveSourceToPane

Function syncActiveSourceToPane

public/js/fileListView.js:2051–2064  ·  view source on GitHub ↗
(paneKey, sourceId)

Source from the content-addressed store, hash-verified

2049let __frTreeSourceId = null;
2050
2051function syncActiveSourceToPane(paneKey, sourceId) {
2052 const targetId = sourceId || getPaneSourceId(paneKey);
2053 const currentId = getGlobalActiveSourceId();
2054 if (!targetId || targetId === currentId) return Promise.resolve(false);
2055
2056 if (typeof window.__frApplyActiveSource === 'function') {
2057 return window.__frApplyActiveSource(targetId, { skipEvent: true, origin: 'pane' });
2058 }
2059
2060 const sel = document.getElementById('sourceSelector');
2061 if (sel) sel.value = targetId;
2062 try { localStorage.setItem('fr_active_source', targetId); } catch (e) { /* ignore */ }
2063 return Promise.resolve(true);
2064}
2065
2066function refreshTreeForSource(folder, sourceId) {
2067 const nextId = sourceId || getGlobalActiveSourceId();

Callers 1

setActivePaneFunction · 0.85

Calls 2

getPaneSourceIdFunction · 0.85
getGlobalActiveSourceIdFunction · 0.85

Tested by

no test coverage detected