prep merge tv-skip-stock-setup
This commit is contained in:
commit
502d43f271
10 changed files with 983 additions and 2 deletions
|
|
@ -33,6 +33,7 @@ import androidx.tv.material3.MaterialTheme
|
|||
import androidx.tv.material3.Surface
|
||||
import com.github.damontecres.wholphin.data.ServerRepository
|
||||
import com.github.damontecres.wholphin.data.RestoredSession
|
||||
import org.justinvisser.wolfskin.tv.recoverWolfskinSession
|
||||
import com.github.damontecres.wholphin.preferences.AppPreferences
|
||||
import com.github.damontecres.wholphin.preferences.PlayerBackend
|
||||
import com.github.damontecres.wholphin.services.AppUpgradeHandler
|
||||
|
|
@ -479,11 +480,13 @@ class MainActivityViewModel
|
|||
fun appResume() {
|
||||
viewModelScope.launchDefault {
|
||||
mutex.withLock {
|
||||
val expected = serverRepository.current.value
|
||||
try {
|
||||
Timber.v("Updating userDto")
|
||||
serverRepository.updateUserDto()
|
||||
} catch (ex: Exception) {
|
||||
Timber.w(ex, "Error during appResume")
|
||||
recoverWolfskinSession(context, ex, expected, serverRepository, setupNavigationManager)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -590,6 +593,7 @@ class MainActivityViewModel
|
|||
} catch (exception: Exception) {
|
||||
if (exception is kotlinx.coroutines.CancellationException) throw exception
|
||||
Timber.w(exception, "Saved launch session revalidation failed")
|
||||
recoverWolfskinSession(context, exception, restoredSession.currentUser, serverRepository, setupNavigationManager)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.github.damontecres.wholphin.services.ScreensaverService
|
|||
import com.github.damontecres.wholphin.services.SetupDestination
|
||||
import com.github.damontecres.wholphin.ui.components.AppScreensaver
|
||||
import org.justinvisser.wolfskin.tv.WolfskinApp
|
||||
import org.justinvisser.wolfskin.tv.WolfskinSetupContent
|
||||
import com.github.damontecres.wholphin.ui.setup.SwitchServerContent
|
||||
import com.github.damontecres.wholphin.ui.setup.SwitchUserContent
|
||||
import com.github.damontecres.wholphin.ui.util.InterfaceCustomization
|
||||
|
|
@ -48,6 +49,7 @@ fun MainContent(
|
|||
backdropService: BackdropService,
|
||||
screensaverService: ScreensaverService,
|
||||
modifier: Modifier = Modifier,
|
||||
setupInterceptor: @Composable (SetupDestination, Modifier) -> Boolean = { key, contentModifier -> WolfskinSetupContent(key, contentModifier) },
|
||||
) {
|
||||
val preferences by rememberUpdatedState(userPreferences)
|
||||
Surface(
|
||||
|
|
@ -72,6 +74,7 @@ fun MainContent(
|
|||
entryProvider = { key ->
|
||||
key as SetupDestination
|
||||
NavEntry(key) {
|
||||
if (setupInterceptor(key, Modifier.fillMaxSize())) return@NavEntry
|
||||
when (key) {
|
||||
SetupDestination.Loading -> {
|
||||
Box(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue