File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ appId : com.squirrel.programmingKyle.clocker
2+ productName : Clocker
3+ win :
4+ target : nsis
5+ artifactName : " clocker-${version}.${ext}"
6+ publish :
7+ provider : github
8+ repo : programmingKyle/clocker
Original file line number Diff line number Diff line change 11{
22 "name" : " clocker" ,
3- "productName" : " clocker " ,
4- "version" : " 1.0 .0" ,
3+ "productName" : " Clocker " ,
4+ "version" : " 0.1 .0" ,
55 "description" : " My Electron application description" ,
66 "main" : " src/index.js" ,
77 "scripts" : {
88 "start" : " electron-forge start" ,
9- "package" : " electron-forge package" ,
10- "make" : " electron-forge make" ,
11- "publish" : " electron-forge publish" ,
12- "lint" : " echo \" No linting configured\" "
9+ "package" : " electron-builder" ,
10+ "make" : " electron-builder --win" ,
11+ "publish" : " electron-builder --publish always"
1312 },
1413 "devDependencies" : {
1514 "@electron-forge/cli" : " ^7.3.0" ,
3029 "license" : " MIT" ,
3130 "dependencies" : {
3231 "chart.js" : " ^4.4.2" ,
33- "electron-squirrel-startup" : " ^1.0.0"
32+ "electron-squirrel-startup" : " ^1.0.0" ,
33+ "electron-updater" : " ^6.1.8"
3434 }
3535}
Original file line number Diff line number Diff line change 1+ const updateOverlay_el = document . getElementById ( 'updateOverlay' ) ;
2+ const startUpdateButton_el = document . getElementById ( 'startUpdateButton' ) ;
3+ const quitUpdateButton_el = document . getElementById ( 'quitUpdateButton' ) ;
4+ const updateControlDiv_el = document . getElementById ( 'updateControlDiv' ) ;
5+
6+ autoUpdater . autoUpdaterCallback ( ( status ) => {
7+ if ( status === 'Update Available' ) {
8+ updateOverlay_el . style . display = 'flex' ;
9+ if ( selectUserTypeOverlay_el . style . display !== 'none' ) {
10+ selectUserTypeOverlay_el . style . display = 'none'
11+ }
12+ }
13+ if ( status === 'Update Downloaded' ) {
14+ updateControlDiv_el . style . display = 'grid' ;
15+ }
16+ } ) ;
17+
18+ startUpdateButton_el . addEventListener ( 'click' , ( ) => {
19+ autoUpdater . restartAndUpdate ( ) ;
20+ } ) ;
21+
22+ quitUpdateButton_el . addEventListener ( 'click' , ( ) => {
23+ autoUpdater . closeApp ( ) ;
24+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88 < script src ="https://cdn.jsdelivr.net/npm/chart.js "> </ script >
99 </ head >
1010 < body >
11+ < div id ="updateOverlay " class ="overlay " style ="display: none; ">
12+ < div class ="stop-container " style ="text-align: center; ">
13+ < div style ="display: grid ">
14+ < h2 > Update Available!</ h2 >
15+ </ div >
16+ < div id ="updateControlDiv " style ="display: none; grid-template-columns: 1fr 1fr; grid-gap: 5px; ">
17+ < button id ="startUpdateButton " class ="input-button "> Update & Restart</ button >
18+ < button id ="quitUpdateButton " class ="input-button "> Update & Quit</ button >
19+ </ div >
20+ </ div >
21+ </ div >
22+
23+
1124 < div class ="base-grid ">
1225 < div class ="frame-grid ">
1326 < h4 style ="color: white; padding: 10px 0px; margin: auto 10px; "> Clocker</ h4 >
@@ -100,5 +113,6 @@ <h3>10.5</h3>
100113 < script src ="graphMonth.js "> </ script >
101114 < script src ="graphAnnual.js "> </ script >
102115 < script src ="graphWeekCompare.js "> </ script >
116+ < script src ="autoUpdater.js "> </ script >
103117 </ body >
104118</ html >
You can’t perform that action at this time.
0 commit comments