-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpatchnotes.js
More file actions
29 lines (26 loc) · 888 Bytes
/
patchnotes.js
File metadata and controls
29 lines (26 loc) · 888 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
29
wrap(function patchNotes() {
const setting = settings.register({
name: 'Disable Patch Notes',
key: 'underscript.disable.patches',
});
fn.cleanData('underscript.update.', scriptVersion, 'last', 'checking', 'latest');
style.add(
'#AlertToast div.uschangelog span:nth-of-type(2) { max-height: 300px; overflow-y: auto; display: block; }',
'#AlertToast div.uschangelog extended { display: none; }',
);
if (setting.value() || !scriptVersion.includes('.')) return;
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',
});
}
});