Show new notification sound banner logic

This commit is contained in:
Benoit Marty 2025-10-07 12:20:24 +02:00 committed by Benoit Marty
parent 71d2c1d9df
commit 4475ed0d37
11 changed files with 150 additions and 2 deletions

View file

@ -22,6 +22,7 @@ class InMemoryAppPreferencesStore(
theme: String? = null,
logLevel: LogLevel = LogLevel.INFO,
traceLockPacks: Set<TraceLogPack> = emptySet(),
showNewNotificationSoundBanner: Boolean = false,
) : AppPreferencesStore {
private val isDeveloperModeEnabled = MutableStateFlow(isDeveloperModeEnabled)
private val customElementCallBaseUrl = MutableStateFlow(customElementCallBaseUrl)
@ -30,6 +31,7 @@ class InMemoryAppPreferencesStore(
private val tracingLogPacks = MutableStateFlow(traceLockPacks)
private val hideInviteAvatars = MutableStateFlow(hideInviteAvatars)
private val timelineMediaPreviewValue = MutableStateFlow(timelineMediaPreviewValue)
private val showNewNotificationSoundBanner = MutableStateFlow(showNewNotificationSoundBanner)
override suspend fun setDeveloperModeEnabled(enabled: Boolean) {
isDeveloperModeEnabled.value = enabled
@ -91,6 +93,14 @@ class InMemoryAppPreferencesStore(
return tracingLogPacks
}
override suspend fun setShowNewNotificationSoundBanner(show: Boolean) {
showNewNotificationSoundBanner.value = show
}
override fun showNewNotificationSoundBanner(): Flow<Boolean> {
return showNewNotificationSoundBanner
}
override suspend fun reset() {
// No op
}