-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpatchnotes.js
More file actions
28 lines (25 loc) · 827 Bytes
/
patchnotes.js
File metadata and controls
28 lines (25 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
wrap(function patchNotes() {
const setting = settings.register({
name: 'Disable Patch Notes',
key: 'underscript.disable.patches',
});
fn.cleanData('underscript.update.', scriptVersion, 'last', 'checking', 'latest');
if (setting.value() || !scriptVersion.includes('.')) return;
style.add(
'#AlertToast div.uschangelog span:nth-of-type(2) { max-height: 300px; overflow-y: auto; display: block; }'
);
const versionKey = `underscript.update.${scriptVersion}`;
if (localStorage.getItem(versionKey)) return;
changelog.get(scriptVersion, true)
.then(notify)
.catch();
function notify(text) {
localStorage.setItem(versionKey, true);
fn.toast({
text,
title: '[UnderScript] Patch Notes',
footer: `v${scriptVersion}`,
className: 'uschangelog',
});
}
});