From 4ab9cae21364c9cbb817e74d6d08ac5eaab2e0a6 Mon Sep 17 00:00:00 2001 From: m Date: Fri, 8 May 2026 16:08:43 +1000 Subject: [PATCH] fix(desktop): provide LocalNamecoin{Preferences,Service} so search can resolve The lazy-init declarations and CompositionLocalProvider entries were lost during the rebase, so SearchScreen always saw null services and skipped Namecoin resolution. Add them back inside the LoggedIn branch alongside LocalTorState. --- .../kotlin/com/vitorpamplona/amethyst/desktop/Main.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt index 7ff47ed4d..c0383fbde 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt @@ -935,6 +935,14 @@ fun App( val account = accountState as AccountState.LoggedIn val nwcConnection by accountManager.nwcConnection.collectAsState() + // Lazy-load Namecoin services — almost never used, no need to keep in + // memory from the start (matches Android lazy pattern) + val namecoinPreferences = remember { DesktopNamecoinPreferences() } + val namecoinService = + remember { + DesktopNamecoinNameService(preferencesProvider = { namecoinPreferences.current }) + } + // Load NWC connection on first composition LaunchedEffect(Unit) { accountManager.loadNwcConnection() @@ -956,6 +964,8 @@ fun App( onRestartApp() }, ), + LocalNamecoinPreferences provides namecoinPreferences, + LocalNamecoinService provides namecoinService, ) { MainContent( layoutMode = layoutMode,