Skip to content

Commit

Permalink
chore: minimize a few lines of duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
feildmaster committed Mar 29, 2022
1 parent d8c399c commit 96f3b3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# UnderScript Changelog

## Version 0.50.2 (2022-03-29)
1. Fixed settings not showing sometimes
1. Fixed setting notes not showing
1. Added another alternate update link

## Version 0.50.1 (2022-03-28)
1. Fixed boolean setting errors
1. Fixed board background setting not applying your background
Expand Down
37 changes: 12 additions & 25 deletions src/base/updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,47 +89,34 @@ wrap(() => {
latest.set(data);
if (updateToast) updateToast.close('stale');
const path = `underscript@${data.version}/${data.unpkg}`;
const css = {
border: '',
height: '',
background: '',
'font-size': '',
margin: '',
'border-radius': '',
};
updateToast = BasicToast({
title: '[UnderScript] Update Available!',
text: `Version ${data.version}.`,
className: 'dismissable',
buttons: [{
text: 'Update',
text: 'Update (github)',
className: 'dismiss',
css: {
border: '',
height: '',
background: '',
'font-size': '',
margin: '',
'border-radius': '',
},
css,
}, {
text: 'Update (unpkg)',
className: 'dismiss',
css: {
border: '',
height: '',
background: '',
'font-size': '',
margin: '',
'border-radius': '',
},
css,
onclick(e) {
location.href = `${baseURL}/${path}`;
this.close('update');
},
}, {
text: 'Update (jsdelivr)',
className: 'dismiss',
css: {
border: '',
height: '',
background: '',
'font-size': '',
margin: '',
'border-radius': '',
},
css,
onclick: (e) => {
location.href = `https://cdn.jsdelivr.net/npm/${path}`;
this.close('update');
Expand Down

0 comments on commit 96f3b3e

Please sign in to comment.