Do not ask to select push distributor in home if notifications are disabled
This commit is contained in:
parent
740ed89638
commit
aa3a808d2c
@ -116,7 +116,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||||||
private fun initialize() {
|
private fun initialize() {
|
||||||
if (isInitialized) return
|
if (isInitialized) return
|
||||||
isInitialized = true
|
isInitialized = true
|
||||||
registerUnifiedPush(distributor = "")
|
registerUnifiedPushIfNeeded()
|
||||||
cleanupFiles()
|
cleanupFiles()
|
||||||
observeInitialSync()
|
observeInitialSync()
|
||||||
checkSessionPushIsOn()
|
checkSessionPushIsOn()
|
||||||
@ -127,6 +127,12 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||||||
viewModelScope.launch { stopOngoingVoiceBroadcastUseCase.execute() }
|
viewModelScope.launch { stopOngoingVoiceBroadcastUseCase.execute() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun registerUnifiedPushIfNeeded() {
|
||||||
|
if(vectorPreferences.areNotificationEnabledForDevice()) {
|
||||||
|
registerUnifiedPush(distributor = "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun registerUnifiedPush(distributor: String) {
|
private fun registerUnifiedPush(distributor: String) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
when (registerUnifiedPushUseCase.execute(distributor = distributor)) {
|
when (registerUnifiedPushUseCase.execute(distributor = distributor)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user