From: Ardis Lu Date: Wed, 10 Aug 2022 04:00:47 +0000 (-0700) Subject: Fix global reference to toast X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=5a7d9883247d3ab53460a225ec1f1a69e30e3f61;p=ardislu.dev Fix global reference to toast --- diff --git a/script.js b/script.js index 8babef2..47b3c47 100644 --- a/script.js +++ b/script.js @@ -10,7 +10,7 @@ const cacheChannel = new BroadcastChannel('cache'); cacheChannel.addEventListener('message', e => { // Ignore static assets like logo.svg, style.css, script.js, etc. if (new URL(e.data.resource).pathname === '/api' && e.data.isUpdated) { - toast.show(); + globalThis.components.get('toast').show(); } }); document.querySelector('dialog > button').addEventListener('click', _ => location.reload());