Skip to content

Commit 8f0c28f

Browse files
committed
chore: race condition fun
1 parent 39e1194 commit 8f0c28f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/composables/useInstallSizeDiff.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export function useInstallSizeDiff(
6969

7070
if (import.meta.client) {
7171
watch(
72-
comparisonVersion,
73-
v => {
72+
[comparisonVersion, () => toValue(packageName)],
73+
([v]) => {
7474
if (v) fetchComparisonSize()
7575
},
7676
{ immediate: true },
@@ -83,6 +83,7 @@ export function useInstallSizeDiff(
8383
const cv = comparisonVersion.value
8484

8585
if (!current || !previous || !cv) return null
86+
if (previous.version !== cv || previous.package !== toValue(packageName)) return null
8687

8788
const sizeRatio =
8889
previous.totalSize > 0 ? (current.totalSize - previous.totalSize) / previous.totalSize : 0

0 commit comments

Comments
 (0)