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

Function loadVisibleSources

public/js/fileActions.js:185–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185async function loadVisibleSources() {
186 if (__copyMoveSourcesCache) return __copyMoveSourcesCache;
187 try {
188 const res = await fetch(withBase('/api/pro/sources/visible.php'), {
189 credentials: 'include',
190 headers: { 'Accept': 'application/json' }
191 });
192 if (!res.ok) return null;
193 const data = await res.json().catch(() => null);
194 if (!data || data.ok !== true || !data.enabled) return null;
195 const list = Array.isArray(data.sources) ? data.sources : [];
196 __copyMoveSourcesCache = list;
197 return list;
198 } catch (e) {
199 return null;
200 }
201}
202
203function populateSourceSelect(selectEl, sources, activeId) {
204 if (!selectEl) return;

Callers 1

initCopyMoveSourceSelectFunction · 0.85

Calls 1

withBaseFunction · 0.85

Tested by

no test coverage detected