Change handling of Integrity button in State

This commit is contained in:
Maroxy 2022-02-20 11:13:18 +01:00
parent 4cd514457c
commit 6be07994cc
No known key found for this signature in database
GPG key ID: F4B27EADB21E3021

View file

@ -103,20 +103,14 @@ export default class State
this.integrityButton.style['display'] = 'none'; this.integrityButton.style['display'] = 'none';
this.settingsButton.style['display'] = 'none'; this.settingsButton.style['display'] = 'none';
// We must specify this files here directly import('./states/CheckIntegrity').then((module) => {
// because otherwise Vite will not bundle 'em module.default(this.launcher).then(() => {
const integrityModule = import('./states/CheckIntegrity'); this.update().then(() => {
this.launchButton.style['display'] = 'block';
(this._state === 'game-launch-available' ? integrityModule : null!) this.settingsButton.style['display'] = 'block';
.then((module) => {
module.default(this.launcher).then(() => {
this.update().then(() => {
this.launchButton.style['display'] = 'block';
this.integrityButton.style['display'] = 'block';
this.settingsButton.style['display'] = 'block';
});
}); });
}); });
});
}; };
this.update().then(async () => { this.update().then(async () => {