File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 11# UnderScript App Changelog
22
33## Version 1.4.0 (2020-03-06)
4- 1 . Fixed UnderScript so it can actually update
4+ 1 . Can now update UnderScript without having to restart
551 . URL's now open in browser
661 . Remember Me now shows that it does something in the app
77
Original file line number Diff line number Diff line change 11const { ipcRenderer } = require ( 'electron' ) ;
22
3- const promise = new Promise ( ( res ) => {
3+ // Acts as a cache for the resulting plugin
4+ const plugin = new Promise ( ( res ) => {
45 document . addEventListener ( 'DOMContentLoaded' , ( ) => {
5- plugin = underscript . plugin ( 'UnderScript App' ) ;
6- res ( plugin ) ;
7- } , { once : true } ) ;
6+ res ( underscript . plugin ( 'UnderScript App' ) ) ;
7+ } ) ;
88} ) ;
99
10- let plugin ;
1110function getPlugin ( ) {
12- if ( plugin ) return Promise . resolve ( plugin ) ;
13- return promise ;
11+ return Promise . resolve ( plugin ) ; // Hand out a fresh promise
1412}
1513
1614ipcRenderer . on ( 'toast' , ( _ , data ) => {
1715 getPlugin ( ) . then ( ( plugin ) => {
16+ if ( ! plugin ) return ; // Should never happen, but who knows
1817 if ( data . refresh ) {
1918 data . onClose = ( ...args ) => {
2019 location . reload ( ) ;
2120 } ;
2221 delete data . refresh ;
2322 }
2423 plugin . toast ( data ) ;
25- return plugin ;
2624 } ) ;
2725} ) ;
2826
You can’t perform that action at this time.
0 commit comments