File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,17 @@ function check_updates() {
3535 var res = async_load[? " result" ];
3636 res = json_parse (res);
3737
38- // Iterate array of releases and get the first (latest) release OR pre-release
39- var release = -1 ;
40- for (var i = 0 ; i < array_length (res); i++) {
41- if (check_prerelease || !res[i].prerelease ) {
42- release = res[i];
43- break ;
38+ if (check_prerelease) {
39+ // Iterate array of releases and get the first (latest) release OR pre-release
40+ var release = -1 ;
41+ for (var i = 0 ; i < array_length (res); i++) {
42+ if (check_prerelease || !res[i].prerelease ) {
43+ release = res[i];
44+ break ;
45+ }
4446 }
47+ } else {
48+ release = res;
4549 }
4650
4751 if (release != -1 ) {
Original file line number Diff line number Diff line change @@ -488,7 +488,11 @@ function control_create() {
488488
489489 // Updates
490490 if (check_update)
491- update_http = http_get (link_releases)
491+ if (check_prerelease) {
492+ update_http = http_get (link_releases)
493+ } else {
494+ update_http = http_get (link_latest)
495+ }
492496 else
493497 update_http = -1
494498 update_download = -1
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ function macros() {
99#macro link_github " https://github.com/OpenNBS/OpenNoteBlockStudio"
1010#macro link_report " https://github.com/OpenNBS/OpenNoteBlockStudio/issues/new/choose"
1111#macro link_releases " https://api.github.com/repos/OpenNBS/OpenNoteBlockStudio/releases"
12+ #macro link_latest " https://api.github.com/repos/OpenNBS/OpenNoteBlockStudio/releases/latest"
1213#macro link_changelog " https://opennbs.org/changelog"
1314#macro link_website " https://opennbs.org/"
1415#macro link_discord " https://discord.gg/sKPGjyVcyy"
You can’t perform that action at this time.
0 commit comments