File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/main/java/to/bitkit/ui/components Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ fun InactivityTracker(
4545 if (isPinEnabled && isPinOnIdleEnabled && isAuthenticated) {
4646 inactivityJob = scope.launch {
4747 delay(INACTIVITY_DELAY )
48- Logger .debug(" Inactivity timeout reached after ${INACTIVITY_DELAY / 1000 } s, isAuthenticated=false ." )
48+ Logger .debug(" Inactivity timeout reached after ${INACTIVITY_DELAY / 1000 } s, resetting isAuthenticated." )
4949 app.setIsAuthenticated(false )
5050 resetInactivityTimeout()
5151 }
@@ -66,14 +66,16 @@ fun InactivityTracker(
6666 val observer = LifecycleEventObserver { _, event ->
6767 when (event) {
6868 Lifecycle .Event .ON_RESUME -> resetInactivityTimeout()
69- Lifecycle .Event .ON_PAUSE -> inactivityJob?.cancel()
69+ Lifecycle .Event .ON_PAUSE -> inactivityJob?.cancel()?. also { inactivityJob = null }
7070 else -> Unit
7171 }
7272 }
7373 lifecycleOwner.lifecycle.addObserver(observer)
7474 onDispose {
7575 lifecycleOwner.lifecycle.removeObserver(observer)
76- inactivityJob?.cancel()
76+ inactivityJob?.cancel()?.also {
77+ inactivityJob = null
78+ }
7779 }
7880 }
7981
You can’t perform that action at this time.
0 commit comments