Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions app/src/main/java/com/getcode/CodeApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,23 @@ fun CodeApp() {
StackEvent.Replace -> CurrentScreen()
}
}
}
}

//Listen for authentication changes here
AuthCheck(
navigator = codeNavigator,
onNavigate = { screens ->
codeNavigator.replaceAll(screens, inSheet = false)
},
onSwitchAccounts = { seed ->
activity?.let {
tlvm.logout(it) {
appState.navigator.replaceAll(LoginScreen(seed))
//Listen for authentication changes here
AuthCheck(
navigator = codeNavigator,
onNavigate = { screens ->
codeNavigator.replaceAll(screens, inSheet = false)
},
onSwitchAccounts = { seed ->
activity?.let {
tlvm.logout(it) {
appState.navigator.replaceAll(LoginScreen(seed))
}
}
}
}
)
}
)
}
}

TopBarContainer(appState)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/getcode/view/components/AuthCheck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ fun AuthCheck(
deeplinkHandler.intent
.flatMapLatest { combine(flowOf(deeplinkHandler.handle(it)), SessionManager.authState) { a, b -> a to b } }
.filter { (result, authState) ->
startupLog("checking auth state=${authState.isAuthenticated}")
// wait for authentication
if (result == null) return@filter false
// wait for authentication
startupLog("checking auth state=${authState.isAuthenticated}")
if( authState.isAuthenticated == null) {
startupLog("awaiting auth state confirmation")
return@filter false
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/getcode/view/main/home/HomeScan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private fun HomeScan(
val navigator = LocalCodeNavigator.current
val scope = rememberCoroutineScope()

var isPaused by rememberSaveable { mutableStateOf(false) }
var isPaused by remember { mutableStateOf(false) }

var kikCodeScannerView: KikCodeScannerView? by remember { mutableStateOf(null) }

Expand Down