From 7320840223c19f16347ac2621eb890d6a71f9d81 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 28 Mar 2025 21:41:20 +0800 Subject: [PATCH] Update example --- examples/api/src/views/Updater.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/api/src/views/Updater.svelte b/examples/api/src/views/Updater.svelte index 2fa5e436..26d074a6 100644 --- a/examples/api/src/views/Updater.svelte +++ b/examples/api/src/views/Updater.svelte @@ -12,10 +12,14 @@ isChecking = true try { const update = await check() - onMessage(`Should update: ${update.available}`) - onMessage(update) + if (update) { + onMessage(`Should update: ${update.available}`) + onMessage(update) - newUpdate = update + newUpdate = update + } else { + onMessage('No update available') + } } catch (e) { onMessage(e) } finally {