Skip to content

Commit d2a9561

Browse files
committed
release 2.2.2
1 parent 96a68c7 commit d2a9561

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "colorpicker",
33
"productName": "colorpicker",
4-
"version": "2.2.1",
4+
"version": "2.2.2",
55
"description": "Colorpicker is a little Electron app that can show colors with hex/rgb code, and generate shading for your color.",
66
"main": "src/main.js",
77
"scripts": {

src/checkUpdate.js

+21-16
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,27 @@ module.exports = {
1616
};
1717

1818
request(options, (err, res, body) => {
19-
let update = JSON.parse(body);
20-
if (semver.gt(update.release, app.getVersion())) {
21-
dialog
22-
.showMessageBox(null, {
23-
message: "A new update of Colorpicker is available",
24-
type: "info",
25-
defaultId: 1,
26-
buttons: ["Show Update", "Ignore"],
27-
})
28-
.then((result) => {
29-
if (result.response === 0) {
30-
shell.openExternal(
31-
"https://github.com/Toinane/colorpicker/releases"
32-
);
33-
}
34-
});
19+
try {
20+
let update = JSON.parse(body);
21+
if (semver.gt(update.release, app.getVersion())) {
22+
dialog
23+
.showMessageBox(null, {
24+
message: "A new update of Colorpicker is available",
25+
type: "info",
26+
defaultId: 1,
27+
buttons: ["Show Update", "Ignore"],
28+
})
29+
.then((result) => {
30+
if (result.response === 0) {
31+
shell.openExternal(
32+
"https://github.com/Toinane/colorpicker/releases"
33+
);
34+
}
35+
});
36+
}
37+
}
38+
catch (error) {
39+
console.error("Error while checking for updates", error);
3540
}
3641
});
3742
},

0 commit comments

Comments
 (0)