Skip to content

Commit 3ff72ee

Browse files
Update feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent d108e2e commit 3ff72ee

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation

feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,19 @@ class DetailsViewModel(
416416
val currentVariant = installedApp.preferredAssetVariant
417417
val currentTokens = installedApp.preferredAssetTokens
418418
val currentGlob = installedApp.assetGlobPattern
419+
val newSiblingCount = installable.size.takeIf { it > 0 }
420+
val sameVariant =
421+
if (fingerprint.variant == null && currentVariant == null) {
422+
true
423+
} else {
424+
fingerprint.variant?.equals(currentVariant, ignoreCase = true) == true
425+
}
419426
val isSameFingerprint =
420-
fingerprint.variant?.equals(currentVariant, ignoreCase = true) == true &&
427+
sameVariant &&
421428
serializedTokens == currentTokens &&
422-
fingerprint.glob == currentGlob
429+
fingerprint.glob == currentGlob &&
430+
pickedIndex == installedApp.pickedAssetIndex &&
431+
newSiblingCount == installedApp.pickedAssetSiblingCount
423432

424433
// Treat the app as "previously unpinned" only when *all* identity
425434
// layers are blank — otherwise we'd nag every time the user
@@ -441,7 +450,7 @@ class DetailsViewModel(
441450
tokens = serializedTokens,
442451
glob = fingerprint.glob,
443452
pickedIndex = pickedIndex,
444-
siblingCount = installable.size.takeIf { it > 0 },
453+
siblingCount = newSiblingCount,
445454
)
446455
if (isFirstPin) {
447456
val label = fingerprint.variant

0 commit comments

Comments
 (0)