Skip to content

Commit b540fcc

Browse files
committed
Bugfix: settings-not-initialized warns at startup
Solution: Await initializeSettings() in initNetworkDiscovery so network timeout/cache settings aren't read before the store finishes loading from disk.
1 parent 9c98856 commit b540fcc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/desktop/src/lib/file-explorer/network/network-store.svelte.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
getSmbCredentials,
1515
} from '$lib/tauri-commands'
1616
import { getNetworkTimeoutMs, getShareCacheTtlMs } from '$lib/settings/network-settings'
17+
import { initializeSettings } from '$lib/settings'
1718
import type { UnlistenFn } from '$lib/tauri-commands'
1819
import type { NetworkHost, DiscoveryState, ShareListResult, ShareListError } from '../types'
1920

@@ -141,6 +142,9 @@ export async function initNetworkDiscovery(): Promise<void> {
141142
if (initialized) return
142143
initialized = true
143144

145+
// Ensure settings are loaded before reading network timeout/cache values
146+
await initializeSettings()
147+
144148
// Load initial data
145149
hosts = await listNetworkHosts()
146150
discoveryState = await getNetworkDiscoveryState()

0 commit comments

Comments
 (0)