Skip to content

Commit 4a6ec5b

Browse files
committed
fix: follow the rabbit
1 parent d02f00d commit 4a6ec5b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ const dataset = computed<VueUiSparklineDatasetItem[]>(() =>
206206
207207
const lastDatapoint = computed(() => dataset.value.at(-1)?.period ?? '')
208208
209-
const isLoop = ref(false)
210-
const showPulse = ref(true)
209+
const isLoop = shallowRef(false)
210+
const showPulse = shallowRef(true)
211211
const keyboardShortcuts = useKeyboardShortcuts()
212212
213213
const cheatCode = [
@@ -221,7 +221,7 @@ const cheatCode = [
221221
222222
type CheatKey = (typeof cheatCode)[number]
223223
224-
const easterEgg = ref<CheatKey[]>([])
224+
const easterEgg = shallowRef<CheatKey[]>([])
225225
let resetTimeout: ReturnType<typeof setTimeout> | undefined
226226
const easterEggResetDelay = 1500
227227
@@ -281,16 +281,22 @@ onKeyDown(
281281
282282
onBeforeUnmount(() => {
283283
resetEasterEgg()
284+
clearTimeout(eggPulseTimeout)
285+
eggPulseTimeout = undefined
284286
})
285287
286288
const eggPulse = ref(false)
287289
290+
let eggPulseTimeout: ReturnType<typeof setTimeout> | undefined
291+
288292
function playEggPulse() {
289293
eggPulse.value = false
290294
void document.documentElement.offsetHeight
291295
eggPulse.value = true
292296
293-
window.setTimeout(() => {
297+
clearTimeout(eggPulseTimeout)
298+
299+
eggPulseTimeout = setTimeout(() => {
294300
eggPulse.value = false
295301
}, 900)
296302
}

0 commit comments

Comments
 (0)