aboutsummaryrefslogtreecommitdiff
path: root/features/changeLogGUI
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
commit0cf3a67c2bbd4cdaa5d364436c9153e6456624f1 (patch)
tree03d6b37ee2f4109875050d61d63f363659031e6b /features/changeLogGUI
parentb94794a3de8827f4bddb5251b010dc32943d79a1 (diff)
downloadSoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.gz
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.bz2
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.zip
make network requests all go on one permenantly open thread
Diffstat (limited to 'features/changeLogGUI')
-rw-r--r--features/changeLogGUI/index.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/features/changeLogGUI/index.js b/features/changeLogGUI/index.js
index 1a75825..0d60b72 100644
--- a/features/changeLogGUI/index.js
+++ b/features/changeLogGUI/index.js
@@ -10,6 +10,7 @@ import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent";
import ProgressBar from "../../../guimanager/GuiElement/ProgressBar"
import SoopyRenderEvent from "../../../guimanager/EventListener/SoopyRenderEvent"
+import { fetch } from "../../utils/networkUtils";
const File = Java.type("java.io.File")
const URL = Java.type("java.net.URL");
const PrintStream = Java.type("java.io.PrintStream");
@@ -125,19 +126,19 @@ class ChangelogPage extends GuiPage {
}
loadChangeLog(){
- let data = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/changelog.json"))
+ fetch("http://soopymc.my.to/api/soopyv2/changelog.json").json(data=>{
- this.changelogData = data.changelog.reverse()
+ this.changelogData = data.changelog.reverse()
+
+ this.downloadableVersion = data.downloadableVersion
+
+ this.updateText()
+ })
- this.downloadableVersion = data.downloadableVersion
}
onOpen(){
- new Thread(()=>{
- this.loadChangeLog()
-
- this.updateText()
- }).start()
+ this.loadChangeLog()
}
// showConfirmUpdatePage(){