mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 05:59:43 +02:00
fix(web): loadQuickStartCases expected enveloped settings from the already-unwrapped shared settingsPromise
app.js resolves settingsPromise to the unwrapped settings object (env?.data ?? null), matching loadAppSettingsFromServer. The loadQuickStartCases consumer still read settings.data.lastUsedCase, which silently dropped the last-used-case preselection; its fallback fetch also missed the envelope unwrap. Align both with the unwrapped shape. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,9 +49,9 @@ Object.assign(CodemanApp.prototype, {
|
||||
// Load settings to get lastUsedCase (reuse shared promise if provided)
|
||||
let lastUsedCase = null;
|
||||
try {
|
||||
const settings = settingsPromise ? await settingsPromise : await fetch('/api/settings').then(r => r.ok ? r.json() : null);
|
||||
if (settings && settings.data) {
|
||||
lastUsedCase = settings.data.lastUsedCase || null;
|
||||
const settings = settingsPromise ? await settingsPromise : await fetch('/api/settings').then(r => r.ok ? r.json() : null).then(env => env?.data ?? null);
|
||||
if (settings) {
|
||||
lastUsedCase = settings.lastUsedCase || null;
|
||||
}
|
||||
} catch {
|
||||
// Ignore settings load errors
|
||||
|
||||
Reference in New Issue
Block a user