refactor: lazy-load Namecoin services on Desktop (not kept in memory from start)

Move Namecoin service initialization from App-level (eager, on every startup)
to inside the LoggedIn branch (only created when user logs in and screens
that use Namecoin are reachable). Matches the Android lazy pattern in AppModules.

Also deduplicate NamecoinSettings: Android module now uses a typealias to the
commons module version, matching the original PR intent.
This commit is contained in:
M
2026-03-30 08:17:09 +11:00
committed by m
parent 5369694b4d
commit 645bcf8f44
2 changed files with 1 additions and 87 deletions
@@ -719,10 +719,6 @@ fun App(
}
val localCache = remember { DesktopLocalCache() }
val namecoinPreferences = remember { DesktopNamecoinPreferences() }
val namecoinService = remember {
DesktopNamecoinNameService(preferencesProvider = { namecoinPreferences.current })
}
val accountState by accountManager.accountState.collectAsState()
val scope = remember { CoroutineScope(SupervisorJob() + Dispatchers.Main) }
@@ -900,10 +896,6 @@ fun App(
ProvideMaterialSymbols(
weight = com.vitorpamplona.amethyst.desktop.platform.PlatformIconWeight.current,
) {
CompositionLocalProvider(
LocalNamecoinPreferences provides namecoinPreferences,
LocalNamecoinService provides namecoinService,
) {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background,
@@ -1068,7 +1060,6 @@ fun App(
}
}
}
} // end CompositionLocalProvider
}
}