Injector v4.8.1: Make new checks async

pull/8/head
Oj18 4 years ago
parent fc044d150d
commit 6586f0504f

@ -1,5 +1,11 @@
# GooseMod Changelog
## v4.8.1 [2020-11-02]
- ### Features
- Made new version checking asynchronous so it does not result in delay when initialising
## v4.8.0 [2020-11-02]
- ### Features

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

@ -92,18 +92,19 @@ const init = async function () {
this.disabledModules = {};
this.lastVersion = localStorage.getItem('goosemodLastVersion');
this.version = '4.8.0';
this.version = '4.8.1';
this.versionHash = '<hash>'; // Hash of built final js file is inserted here via build script
const latestInjectVersionInfo = await (await fetch('https://goosemod-api.netlify.app/injectVersion.json')).json();
fetch('https://goosemod-api.netlify.app/injectVersion.json').then((x) => x.json().then((latestInjectVersionInfo) => {
if (latestInjectVersionInfo.version !== this.version) {
this.showToast('Warning: Version number does not match latest public release', {timeout: 3000});
}
if (latestInjectVersionInfo.version !== this.version) {
this.showToast('Warning: Version number does not match latest public release', {timeout: 3000});
}
if (latestInjectVersionInfo.hash !== this.versionHash) {
this.showToast('Warning: Version hash does not match latest public release', {timeout: 3000});
}
}));
if (latestInjectVersionInfo.hash !== this.versionHash) {
this.showToast('Warning: Version hash does not match latest public release', {timeout: 3000});
}
if (this.lastVersion && this.lastVersion !== this.version) {
this.goosemodChangelog.show();

Loading…
Cancel
Save