Skip to content

Commit 0941d82

Browse files
committed
fix: clear interval once fetched
1 parent f6a9d16 commit 0941d82

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

app/pages/index.vue

+11-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ const isCallback = ref(!!useRoute().query.installation_id)
55
const numRepos = allowedRepos.value?.length
66
77
if (import.meta.client && isCallback.value) {
8-
setInterval(() => {
8+
const interval = setInterval(() => {
99
refresh()
1010
}, 1000)
11-
watch(allowedRepos, (newRepos) => {
11+
const unsub = watch(allowedRepos, (newRepos) => {
1212
if (newRepos.length === numRepos) return
1313
1414
isCallback.value = false
15-
}, { once: true })
15+
clearInterval(interval)
16+
unsub()
17+
})
1618
}
1719
</script>
1820

@@ -36,18 +38,20 @@ if (import.meta.client && isCallback.value) {
3638
</template>
3739
</NuxtLink>
3840
<hr>
39-
<section class="text-center">
41+
<section
42+
v-if="allowedRepos.length"
43+
class="text-center"
44+
>
4045
or pick a repository to browse issue clusters
41-
<ul class="p-0">
46+
<ul class="p-0 flex flex-col gap-2">
4247
<li
4348
v-for="repo in allowedRepos"
4449
:key="repo"
4550
class="list-none"
4651
>
4752
<NuxtLink
4853
:to="`/${repo}`"
49-
class="no-underline text-gray-400 hover:underline active:text-white"
50-
>
54+
class="no-underline text-gray-400 hover:underline active:text- >
5155
{{ repo }}
5256
</NuxtLink>
5357
</li>

0 commit comments

Comments
 (0)