Skip to content

Commit

Permalink
url may be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Sep 10, 2023
1 parent 5f8044c commit 4b82c07
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,16 @@ export default {
})
while (true) {
const { url } = await dispatch()
const data = await fetch(url).then(w => w.text())
receipt(url, data)
this.$gtag.event('Dispatch', {
event_name: 'dispatch',
code: JSON.parse(data).code
})
if (url) {
const data = await fetch(url).then(w => w.text())
receipt(url, data)
this.$gtag.event('Dispatch', {
event_name: 'dispatch',
code: JSON.parse(data).code
})
} else {
await wait(1000 * 20)
}
await wait(1000 * 10)
}
},
Expand Down

0 comments on commit 4b82c07

Please sign in to comment.