mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3475 Notifications | Fix | Fix Redundant “Allow Notifications” Prompt (#2284)
This commit is contained in:
parent
e386ef1c9e
commit
0c46744963
1 changed files with 7 additions and 3 deletions
|
@ -183,9 +183,13 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), AppNavigation.Pr
|
|||
}
|
||||
is Command.RequestNotificationPermission -> {
|
||||
runCatching {
|
||||
findNavController(R.id.fragment).navigate(
|
||||
R.id.requestNotificationPermissionDialog
|
||||
)
|
||||
val controller = findNavController(R.id.fragment)
|
||||
val currentDestination = controller.currentDestination
|
||||
if (currentDestination?.id != R.id.requestNotificationPermissionDialog) {
|
||||
controller.navigate(R.id.requestNotificationPermissionDialog)
|
||||
} else {
|
||||
Timber.w("Request permission dialog already in stack.")
|
||||
}
|
||||
}.onFailure {
|
||||
Timber.e(it, "Error while navigation")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue