From d2a76ec8d2ce5e8cef16a1442b7c3f32cfde66b2 Mon Sep 17 00:00:00 2001 From: Leeous Date: Sun, 12 May 2019 11:25:45 -0400 Subject: [PATCH] add version checking, fix major bug --- src/js/script.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/js/script.js b/src/js/script.js index e043b9c..42ef7c3 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -31,6 +31,7 @@ addonToCreateData = { "tags": [], "ignore": [] } +currentAppVersion = "v1.1"; @@ -46,6 +47,20 @@ $(document).ready(() => { ipcRenderer.on("addonInfo", (event, message) => { getAddonInfoFromSteam(message) }); + + // Check current version, let user know if it differs + $.ajax({ + type: "GET", + url: "https://api.github.com/repos/Leeous/gmod-addon-tool/releases/latest", + dataType: "json" + }).done((data) => { + if (data.tag_name != currentAppVersion) { + var open = confirm("Update " + data.tag_name + " available."); + if (open) { + shell.openExternal("https://github.com/Leeous/gmod-addon-tool/releases"); + } + } + }) function getAddonInfoFromSteam(message) { arrayOfAddonIds = message; @@ -173,6 +188,10 @@ $(document).ready(() => { $('#dir_prompt_next button').click(() => { $('#directory_selection').fadeOut(() => { $('#addon_management').fadeIn(); + $('#addon_management_prompt').fadeIn(); + win.setBounds({ + height: 175, + }) }); }) @@ -189,7 +208,6 @@ $(document).ready(() => { $('#create_new_addon_button').click(() => { $('#addon_management_prompt').fadeOut(() => { win.setBounds({height: 250}) - $('#create_new_addon, #addonDirPrompt').fadeIn() }) })