diff --git a/containers/libreportal/frontend/core/setup/js/setup-wizard.js b/containers/libreportal/frontend/core/setup/js/setup-wizard.js index 9836123..c63626a 100755 --- a/containers/libreportal/frontend/core/setup/js/setup-wizard.js +++ b/containers/libreportal/frontend/core/setup/js/setup-wizard.js @@ -478,7 +478,19 @@ class SetupWizard { const res = await fetch('/data/system/storage.json', { cache: 'no-store' }); if (!res.ok) throw new Error(`HTTP ${res.status}`); const data = await res.json(); - this.storageCandidates = Array.isArray(data.candidates) ? data.candidates : []; + // Both halves of the feed. `candidates` is drives that could be added; + // `locations` is the ones already registered — which the step showed as + // nothing at all, so registering a drive made it VANISH from Storage and + // the note went back to claiming only one drive was found. A registered + // location is the clearest case of a usable drive there is. + const registered = (Array.isArray(data.locations) ? data.locations : []) + .filter(l => l && l.path && l.path !== (data.primary || '')) + .map(l => Object.assign({ verdict: l.state === 'ok' ? 'ok' : 'warn', registered: true }, l)); + const unregistered = Array.isArray(data.candidates) ? data.candidates : []; + // A path can legitimately appear in both while a registration settles. + const seen = new Set(registered.map(l => (l.path || '').replace(/\/$/, ''))); + this.storageCandidates = registered.concat( + unregistered.filter(c => !seen.has((c.path || '').replace(/\/$/, '')))); this.storageSystem = data.system || null; } catch (e) { console.log('[setup] storage scan unavailable:', e.message); @@ -601,7 +613,9 @@ class SetupWizard { : (refused ? 'can\u2019t be used' : (c.verdict === 'warn' ? 'needs care' : '')); - const title = o.system ? this._primaryLabel() : c.path; + // A registered location has a name the user chose; an unregistered + // candidate only has a path. + const title = o.system ? this._primaryLabel() : (c.name || c.path); return `