mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Few minor fixes (#1427)
## Description - Fix always showing the user list on app cold start even with auto sign in enabled - Ignore unknown JSON keys when restoring view options or filters from the database making them more backward compatible for devs switching branches - Don't show a view more card on collection detail page rows, it's not necessary ### Related issues First bug was introduced by #1367 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
223d2d1f71
commit
6f11a3711f
4 changed files with 16 additions and 9 deletions
|
|
@ -434,18 +434,18 @@ class MainActivityViewModel
|
|||
appUpgradeHandler.copySubfont(false)
|
||||
val prefs =
|
||||
preferences.data.firstOrNull() ?: AppPreferences.getDefaultInstance()
|
||||
val allowAutoSignIn =
|
||||
val profileProtected =
|
||||
serverRepository.currentUser.value?.let {
|
||||
!it.hasPin && !it.requireLogin
|
||||
it.hasPin || it.requireLogin
|
||||
} == true
|
||||
if (prefs.signInAutomatically && allowAutoSignIn) {
|
||||
if (prefs.signInAutomatically && !profileProtected) {
|
||||
val current =
|
||||
serverRepository.restoreSession(
|
||||
prefs.currentServerId?.toUUIDOrNull(),
|
||||
prefs.currentUserId?.toUUIDOrNull(),
|
||||
)
|
||||
if (current != null) {
|
||||
if (current.user.hasPin) {
|
||||
if (current.user.hasPin || current.user.requireLogin) {
|
||||
navigationManager.navigateTo(SetupDestination.UserList(current.server))
|
||||
} else {
|
||||
// Restored
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue