Skip to content

Commit 7320840

Browse files
committed
Update example
1 parent edbae3e commit 7320840

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

examples/api/src/views/Updater.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
isChecking = true
1313
try {
1414
const update = await check()
15-
onMessage(`Should update: ${update.available}`)
16-
onMessage(update)
15+
if (update) {
16+
onMessage(`Should update: ${update.available}`)
17+
onMessage(update)
1718
18-
newUpdate = update
19+
newUpdate = update
20+
} else {
21+
onMessage('No update available')
22+
}
1923
} catch (e) {
2024
onMessage(e)
2125
} finally {

0 commit comments

Comments
 (0)