diff options
Diffstat (limited to 'features/changeLogGUI/index.js')
-rw-r--r-- | features/changeLogGUI/index.js | 17 |
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(){ |