Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: android demo #86

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
import co.touchlab.kermit.Logger
import com.powersync.PowerSyncDatabase
import com.powersync.connector.supabase.SupabaseConnector
import io.github.jan.supabase.auth.status.RefreshFailureCause
import io.github.jan.supabase.auth.status.SessionStatus
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
Expand Down Expand Up @@ -36,9 +37,13 @@ internal class AuthViewModel(
db.connect(supabase)
navController.navigate(Screen.Home)
}

SessionStatus.LoadingFromStorage -> Logger.e("Loading from storage")
SessionStatus.NetworkError -> Logger.e("Network error")
SessionStatus.Initializing -> Logger.e("Loading from storage")
is SessionStatus.RefreshFailure -> {
when (it.cause) {
is RefreshFailureCause.NetworkError -> Logger.e("Network error occurred")
is RefreshFailureCause.InternalServerError -> Logger.e("Internal server error occurred")
}
}
is SessionStatus.NotAuthenticated -> {
db.disconnectAndClear()
_authState.value = AuthState.SignedOut
Expand Down
Loading