mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 04:08:44 +03:00
Do not ask to select push distributor in home if notifications are disabled
This commit is contained in:
parent
740ed89638
commit
aa3a808d2c
1 changed files with 7 additions and 1 deletions
|
@ -116,7 +116,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||
private fun initialize() {
|
||||
if (isInitialized) return
|
||||
isInitialized = true
|
||||
registerUnifiedPush(distributor = "")
|
||||
registerUnifiedPushIfNeeded()
|
||||
cleanupFiles()
|
||||
observeInitialSync()
|
||||
checkSessionPushIsOn()
|
||||
|
@ -127,6 +127,12 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||
viewModelScope.launch { stopOngoingVoiceBroadcastUseCase.execute() }
|
||||
}
|
||||
|
||||
private fun registerUnifiedPushIfNeeded() {
|
||||
if(vectorPreferences.areNotificationEnabledForDevice()) {
|
||||
registerUnifiedPush(distributor = "")
|
||||
}
|
||||
}
|
||||
|
||||
private fun registerUnifiedPush(distributor: String) {
|
||||
viewModelScope.launch {
|
||||
when (registerUnifiedPushUseCase.execute(distributor = distributor)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue