Improve AnnouncementService.

This commit is contained in:
Benoit Marty 2025-10-08 09:45:44 +02:00
parent 59ef782b3e
commit 752e846b1c
20 changed files with 169 additions and 81 deletions

View file

@ -30,7 +30,6 @@ private val hideInviteAvatarsKey = booleanPreferencesKey("hideInviteAvatars")
private val timelineMediaPreviewValueKey = stringPreferencesKey("timelineMediaPreviewValue")
private val logLevelKey = stringPreferencesKey("logLevel")
private val traceLogPacksKey = stringPreferencesKey("traceLogPacks")
private val showNewNotificationSoundBannerKey = booleanPreferencesKey("showNewNotificationSoundBanner")
@ContributesBinding(AppScope::class)
@Inject
@ -146,19 +145,6 @@ class DefaultAppPreferencesStore(
}
}
override suspend fun setShowNewNotificationSoundBanner(show: Boolean) {
store.edit { prefs ->
prefs[showNewNotificationSoundBannerKey] = show
}
}
override fun showNewNotificationSoundBanner(): Flow<Boolean> {
return store.data.map { prefs ->
// Default is false, but a migration will set it to true on application upgrade (see AppMigration08)
prefs[showNewNotificationSoundBannerKey] ?: false
}
}
override suspend fun reset() {
store.edit { it.clear() }
}