()
| 268 | } |
| 269 | |
| 270 | async function loadVisibleSourcesForMove() { |
| 271 | if (__moveFolderSourcesCache) return __moveFolderSourcesCache; |
| 272 | try { |
| 273 | const res = await fetch(withBase('/api/pro/sources/visible.php'), { |
| 274 | credentials: 'include', |
| 275 | headers: { 'Accept': 'application/json' } |
| 276 | }); |
| 277 | if (!res.ok) return null; |
| 278 | const data = await res.json().catch(() => null); |
| 279 | if (!data || data.ok !== true || !data.enabled) return null; |
| 280 | const list = Array.isArray(data.sources) ? data.sources : []; |
| 281 | __moveFolderSourcesCache = list; |
| 282 | return list; |
| 283 | } catch (e) { |
| 284 | return null; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | function populateMoveSourceSelect(selectEl, sources, activeId) { |
| 289 | if (!selectEl) return; |
no test coverage detected