Skip to content

Commit 41a1ff3

Browse files
committed
feat: notify of updates on page load
1 parent e7c1bbd commit 41a1ff3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/hooks/updates.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async function check(auto = true) {
158158
eventManager.emit(':update:finished', auto);
159159
}
160160

161-
const updateFound = [...pendingUpdates.values()].find(({ announce = true }) => announce);
161+
const updateFound = [...pendingUpdates.values()].filter(({ announce = true }) => announce).length;
162162
if (updateFound) {
163163
finish();
164164
// TODO: translation
@@ -189,6 +189,11 @@ function setup() {
189189
} else {
190190
autoTimeout = setTimeout(check, timeout);
191191
}
192+
193+
const updateFound = [...pendingUpdates.values()].filter(({ announce = true }) => announce).length;
194+
if (updateFound) {
195+
notify('Updates available.', true);
196+
}
192197
}
193198

194199
function open() {

0 commit comments

Comments
 (0)