Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-02 23:41:01 +03:00
parent 3580350769
commit 8aba7b07d1
49 changed files with 172 additions and 134 deletions

View file

@ -67,10 +67,12 @@ class DefaultNotificationsRepository @Inject constructor(
}
override suspend fun setNotificationsWasEnabledAutomatically(userWalletId: String) {
appPreferencesStore.editData {
it.setObjectMap(
appPreferencesStore.editData { preferences ->
preferences.setObjectMap(
key = PreferencesKeys.NOTIFICATIONS_AUTOMATICALLY_ENABLED_STATES_KEY,
value = it.getObjectMap<Boolean>(PreferencesKeys.NOTIFICATIONS_AUTOMATICALLY_ENABLED_STATES_KEY)
value = preferences.getObjectMap<Boolean>(
PreferencesKeys.NOTIFICATIONS_AUTOMATICALLY_ENABLED_STATES_KEY,
)
.plus(userWalletId to true),
)
}

View file

@ -23,7 +23,7 @@ internal class DefaultPushNotificationsRepository @Inject constructor(
) : PushNotificationsRepository {
override suspend fun createApplicationId(pushToken: String?): ApplicationId = withContext(dispatchers.io) {
tangemTechApi.createApplicationId(
val appId = tangemTechApi.createApplicationId(
NotificationApplicationCreateBody(
platform = appInfoProvider.platform.lowercase(),
device = appInfoProvider.device,
@ -33,7 +33,9 @@ internal class DefaultPushNotificationsRepository @Inject constructor(
version = appInfoProvider.appVersion,
pushToken = pushToken,
),
).getOrThrow().appId.let(::ApplicationId)
).getOrThrow().appId
ApplicationId(appId)
}
override suspend fun saveApplicationId(appId: ApplicationId) {