File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang="ts" setup>
2+ import { whenever } from ' @vueuse/core'
23import { computed , watch , watchEffect } from ' vue'
3- import { useTauriEvent } from ' ./composables/useTauriEvent '
4+ import { useCountDown } from ' ./composables/useCountDown '
45import * as Gitification from ' ./gitification/index'
56import * as UI from ' ./ui'
67import * as Views from ' ./views'
@@ -39,11 +40,21 @@ watch(() => Gitification.state.theme, (theme) => {
3940 }
4041}, { immediate: true })
4142
42- useTauriEvent (' window:hidden' , () => {
43- if (Gitification .state .currentUser != null ) {
44- Gitification .router .navigate (' home' )
45- }
43+ const [timerZero, resetTimer] = useCountDown (5 )
44+
45+ whenever (timerZero , () => {
46+ resetTimer ()
47+
48+ Gitification .actions
49+ .fetchThreads ()
4650})
51+
52+ whenever (() => Gitification .state .currentUser , () => {
53+ resetTimer ()
54+
55+ Gitification .actions
56+ .fetchThreads ()
57+ }, { immediate: true })
4758 </script >
4859
4960<template >
Original file line number Diff line number Diff line change @@ -29,20 +29,6 @@ useKey('esc', Gitification.actions.clearThreadSelection)
2929useTauriEvent (' window:hidden' , Gitification .actions .clearThreadSelection )
3030onScopeDispose (Gitification .actions .clearThreadSelection )
3131
32- const [timerZero, resetTimer] = useCountDown (60 )
33-
34- whenever (timerZero , () => {
35- Gitification .actions
36- .fetchThreads ()
37- .finally (resetTimer )
38- })
39-
40- onMounted (() => {
41- Gitification .actions
42- .fetchThreads (true )
43- .finally (resetTimer )
44- })
45-
4632// Click empty space to clear selection
4733useEventListener (
4834 () => document .querySelector (' #app' ) as HTMLElement ,
You can’t perform that action at this time.
0 commit comments