Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
PokeClicker
Pokeclicker-desktop
Commits
4e16eb3f
Commit
4e16eb3f
authored
4 years ago
by
RedSparr0w
Browse files
Options
Download
Email Patches
Plain Diff
Fixup notifications
parent
32ddcb80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.js
+23
-0
src/main.js
with
23 additions
and
0 deletions
+23
-0
src/main.js
+
23
-
0
View file @
4e16eb3f
...
...
@@ -14,6 +14,7 @@ const Zip = require('adm-zip');
let
checkForUpdatesInterval
;
let
newVersion
=
'
0.0.0
'
;
let
currentVersion
=
'
0.0.0
'
;
let
windowClosed
=
false
;
let
mainWindow
;
...
...
@@ -31,6 +32,9 @@ function createWindow() {
mainWindow
.
setMenuBarVisibility
(
false
);
mainWindow
.
loadURL
(
`file://
${
__dirname
}
/pokeclicker-master/docs/index.html`
);
mainWindow
.
on
(
'
close
'
,
(
event
)
=>
{
windowClosed
=
true
})
mainWindow
.
on
(
'
closed
'
,
()
=>
{
mainWindow
=
null
;
});
...
...
@@ -177,6 +181,9 @@ const downloadUpdate = async (initial = false) => {
}
const
downloadUpdateFailed
=
()
=>
{
// If client exe updating, return
if
(
windowClosed
)
return
;
const
userResponse
=
dialog
.
showMessageBoxSync
(
mainWindow
,
{
type
:
'
error
'
,
title
:
'
PokeClicker - Update failed!
'
,
...
...
@@ -265,5 +272,21 @@ try {
}
try
{
autoUpdater
.
on
(
'
update-downloaded
'
,
()
=>
{
const
userResponse
=
dialog
.
showMessageBoxSync
(
mainWindow
,
{
title
:
'
PokeClicker - Client Update Available!
'
,
message
:
`There is a new client update available,\nWould you like to install it now?\n\n`
,
icon
:
`
${
__dirname
}
/icon.ico`
,
buttons
:
[
'
Restart App Now
'
,
'
Later
'
],
noLink
:
true
,
});
switch
(
userResponse
)
{
case
0
:
windowClosed
=
true
;
autoUpdater
.
quitAndInstall
(
true
,
true
);
break
;
}
});
autoUpdater
.
checkForUpdatesAndNotify
()
}
catch
(
e
)
{}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets