Skip to content

Commit 3b4c6ad

Browse files
committed
feat: silence underscript update (and place it in generic update)
1 parent baad4a9 commit 3b4c6ad

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/base/underscript/updates.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ wrap(() => {
4040
if (!data || !isNewer(data)) return false;
4141
eventManager.once(':update:finished :update:force', () => {
4242
updateToast?.close('stale');
43+
if (data.announce) return;
4344
updateToast = Toast({
4445
title: '[UnderScript] Update Available!',
4546
text: `Version ${data.version}.`,
@@ -67,13 +68,11 @@ wrap(() => {
6768
url: await checker.getDownload(data),
6869
version: await checker.getVersion(data),
6970
time: data.assets.find(({ name }) => name.endsWith('.user.js')).updated_at,
71+
announce: silent.value(),
72+
plugin,
7073
};
7174
if (compareAndToast(update)) {
72-
register({
73-
...update,
74-
plugin,
75-
announce: false,
76-
});
75+
register(update);
7776
}
7877
} catch (error) {
7978
debugToast(error);

src/hooks/updates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const disabled = settings.register({
3030
category: 'Updates',
3131
});
3232

33-
const silent = settings.register({
33+
export const silent = settings.register({
3434
name: 'Run automatic updates in the background',
3535
key: 'underscript.updates.silent',
3636
category: 'Updates',

0 commit comments

Comments
 (0)