Skip to content

Commit 896723f

Browse files
committed
fix: cleanup timeout
1 parent 6af5512 commit 896723f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/components/Package/Likes.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ const showLikeFloat = shallowRef(false)
1414
const likeFloatKey = shallowRef(0)
1515
let likeFloatTimer: ReturnType<typeof setTimeout> | null = null
1616
17+
onUnmounted(() => {
18+
if (likeFloatTimer !== null) {
19+
clearTimeout(likeFloatTimer)
20+
likeFloatTimer = null
21+
}
22+
})
23+
1724
const heartAnimStyle = computed(() => {
1825
if (likeAnimKey.value === 0 || prefersReducedMotion.value) return {}
1926
return {

0 commit comments

Comments
 (0)