Fixes the crash on starting when the contentResolver is not ready yet.

This commit is contained in:
Vitor Pamplona
2025-09-08 15:50:07 -04:00
parent ac2609b4f6
commit 4c8456c4af
2 changed files with 3 additions and 3 deletions

View File

@@ -161,7 +161,7 @@ class Amethyst : Application() {
AccountCacheState( AccountCacheState(
geolocationFlow = locationManager.geohashStateFlow, geolocationFlow = locationManager.geohashStateFlow,
nwcFilterAssembler = sources.nwc, nwcFilterAssembler = sources.nwc,
contentResolver = contentResolver, contentResolverFn = ::contentResolverFn,
cache = cache, cache = cache,
client = client, client = client,
) )

View File

@@ -44,7 +44,7 @@ import kotlinx.coroutines.flow.StateFlow
class AccountCacheState( class AccountCacheState(
val geolocationFlow: StateFlow<LocationState.LocationResult>, val geolocationFlow: StateFlow<LocationState.LocationResult>,
val nwcFilterAssembler: NWCPaymentFilterAssembler, val nwcFilterAssembler: NWCPaymentFilterAssembler,
val contentResolver: ContentResolver, val contentResolverFn: () -> ContentResolver,
val cache: LocalCache, val cache: LocalCache,
val client: INostrClient, val client: INostrClient,
) { ) {
@@ -75,7 +75,7 @@ class AccountCacheState(
NostrSignerExternal( NostrSignerExternal(
pubKey = accountSettings.keyPair.pubKey.toHexKey(), pubKey = accountSettings.keyPair.pubKey.toHexKey(),
packageName = packageName, packageName = packageName,
contentResolver = contentResolver, contentResolver = contentResolverFn(),
) )
} }
}, },