Skip to content

Commit

Permalink
release 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Toinane committed Jun 4, 2024
1 parent 96a68c7 commit d2a9561
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "colorpicker",
"productName": "colorpicker",
"version": "2.2.1",
"version": "2.2.2",
"description": "Colorpicker is a little Electron app that can show colors with hex/rgb code, and generate shading for your color.",
"main": "src/main.js",
"scripts": {
Expand Down
37 changes: 21 additions & 16 deletions src/checkUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,27 @@ module.exports = {
};

request(options, (err, res, body) => {
let update = JSON.parse(body);
if (semver.gt(update.release, app.getVersion())) {
dialog
.showMessageBox(null, {
message: "A new update of Colorpicker is available",
type: "info",
defaultId: 1,
buttons: ["Show Update", "Ignore"],
})
.then((result) => {
if (result.response === 0) {
shell.openExternal(
"https://github.com/Toinane/colorpicker/releases"
);
}
});
try {
let update = JSON.parse(body);
if (semver.gt(update.release, app.getVersion())) {
dialog
.showMessageBox(null, {
message: "A new update of Colorpicker is available",
type: "info",
defaultId: 1,
buttons: ["Show Update", "Ignore"],
})
.then((result) => {
if (result.response === 0) {
shell.openExternal(
"https://github.com/Toinane/colorpicker/releases"
);
}
});
}
}
catch (error) {
console.error("Error while checking for updates", error);
}
});
},
Expand Down

0 comments on commit d2a9561

Please sign in to comment.