diff --git a/app/api/settings/route.ts b/app/api/settings/route.ts index ed688c5f..5b2f95c1 100644 --- a/app/api/settings/route.ts +++ b/app/api/settings/route.ts @@ -53,10 +53,7 @@ export async function GET(request: NextRequest) { try { const settings = await loadUserSettings(username, serverUrl); - if (!settings) { - return NextResponse.json({ error: 'No settings found' }, { status: 404 }); - } - return NextResponse.json({ settings }); + return NextResponse.json({ settings: settings || null }); } catch (error) { const message = error instanceof Error ? error.message : 'Unknown error'; const code = (error as NodeJS.ErrnoException).code; diff --git a/stores/settings-store.ts b/stores/settings-store.ts index 2631a139..3916b654 100644 --- a/stores/settings-store.ts +++ b/stores/settings-store.ts @@ -510,10 +510,14 @@ export const useSettingsStore = create()( }, }); if (!res.ok) { - syncLog('No server settings found (status', res.status + ')'); + syncLog('Settings fetch failed (status', res.status + ')'); return false; } const { settings } = await res.json(); + if (!settings) { + syncLog('No server settings found yet'); + return false; + } if (settings && typeof settings === 'object') { isLoadingFromServer = true; get().importSettings(JSON.stringify(settings));