File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
demos/android-supabase-todolist/app/src/main/java/com/powersync/androidexample Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
55import co.touchlab.kermit.Logger
66import com.powersync.PowerSyncDatabase
77import com.powersync.connector.supabase.SupabaseConnector
8+ import io.github.jan.supabase.auth.status.RefreshFailureCause
89import io.github.jan.supabase.auth.status.SessionStatus
910import kotlinx.coroutines.flow.MutableStateFlow
1011import kotlinx.coroutines.flow.StateFlow
@@ -36,9 +37,13 @@ internal class AuthViewModel(
3637 db.connect(supabase)
3738 navController.navigate(Screen .Home )
3839 }
39-
40- SessionStatus .LoadingFromStorage -> Logger .e(" Loading from storage" )
41- SessionStatus .NetworkError -> Logger .e(" Network error" )
40+ SessionStatus .Initializing -> Logger .e(" Loading from storage" )
41+ is SessionStatus .RefreshFailure -> {
42+ when (it.cause) {
43+ is RefreshFailureCause .NetworkError -> Logger .e(" Network error occurred" )
44+ is RefreshFailureCause .InternalServerError -> Logger .e(" Internal server error occurred" )
45+ }
46+ }
4247 is SessionStatus .NotAuthenticated -> {
4348 db.disconnectAndClear()
4449 _authState .value = AuthState .SignedOut
You can’t perform that action at this time.
0 commit comments