Skip to content

Commit 198dd32

Browse files
committed
Fixing JS for testing for new versions.
1 parent 9e2f5e1 commit 198dd32

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

interfaces/default/js/default.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ $(document).ready(function () {
4040
e.preventDefault()
4141
notify('Update','Checking for update.','info')
4242
$.getJSON(WEBDIR + 'update/', function (data) {
43-
if (data == null || !$.isNumeric(data[0]) || data[0] < 0) {
44-
notify('Update', 'Failed. Check errorlog.', 'error')
45-
} else if (data[0] == 0) {
43+
if (data == 0) {
4644
notify('Update', 'Already running latest version.', 'success')
47-
} else {
45+
} else if ($.isNumeric(data[0] && data[0] > 0)) {
4846
if (confirm('Your are '+data[0]+' versions behind. Update to latest version?')) {
4947
$.post(WEBDIR + 'update/', function (data) {
5048
if (data == 1) {
@@ -56,6 +54,8 @@ $(document).ready(function () {
5654
checkUpdate()
5755
})
5856
}
57+
} else {
58+
notify('Update', 'Failed. Check errorlog.', 'error')
5959
}
6060
})
6161
})

0 commit comments

Comments
 (0)