Skip to content

Commit 0d16525

Browse files
Merge pull request #9 from jbcarras/main
Fix swipe polling bug
2 parents 3601320 + f705fba commit 0d16525

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

client/src/pages/Swipe.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ const refreshQueueLen = () => {
7070
}
7171
}).then(json => {
7272
queueLen.value = json["size"]
73-
pollTimeout = setTimeout(refreshQueueLen, 2000)
7473
})
7574
}
7675
77-
refreshQueueLen()
76+
const pollQueueLen = () => {
77+
refreshQueueLen()
78+
pollTimeout = setTimeout(pollQueueLen, 2000)
79+
}
80+
81+
pollQueueLen()
7882
7983
// stop polling when leaving page
8084
router.beforeEach((to, from, next) => {

0 commit comments

Comments
 (0)