Skip to content

Commit b61b26e

Browse files
committed
fetch reject on error
1 parent 77d66b1 commit b61b26e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/js/version.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
function versionCheck() {
2-
const lastChecked = store.get('lastChecked')
3-
const t = new Date();
4-
const today= `${t.getDate()}${t.getMonth()}${t.getFullYear()}`
5-
if(lastChecked==today) return // check just once a day
2+
// const lastChecked = store.get('lastChecked')
3+
// const t = new Date();
4+
// const today= `${t.getDate()}${t.getMonth()}${t.getFullYear()}`
5+
// if(lastChecked==today) return // check just once a day
66
fetch('https://api.github.com/repos/Koushikphy/Interactive_Data_Editor/releases/latest')
7-
.then(response => response.json())
7+
.then(response => response.ok ? response.json() : Promise.reject(response))
88
.then(data => {
99
var body = data.body
1010
var new_ver = data.tag_name
1111
var cur_var = `v${require('../../package.json').version}`
1212
console.log(body, new_ver)
13-
store.set('lastChecked',today)
13+
// store.set('lastChecked',today)
1414
if (new_ver != cur_var) {
1515
var res = dialog.showMessageBoxSync({
1616
type: "question",

0 commit comments

Comments
 (0)