mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Disable game operations while no game is detected
This commit is contained in:
@@ -253,5 +253,13 @@
|
||||
static setUIState(state) {
|
||||
document.body.setAttribute('data-state', state);
|
||||
}
|
||||
|
||||
static enableGameOperations(enable) {
|
||||
document.getElementById('sortButton').disabled = !enable;
|
||||
document.getElementById('updateMasterlistButton').disabled = !enable;
|
||||
document.getElementById('wipeUserlistButton').disabled = !enable;
|
||||
document.getElementById('copyLoadOrderButton').disabled = !enable;
|
||||
document.getElementById('refreshContentButton').disabled = !enable;
|
||||
}
|
||||
};
|
||||
}));
|
||||
|
||||
@@ -315,6 +315,9 @@ function onCloseSettingsDialog(evt) {
|
||||
loot.query('closeSettings', settings).then(JSON.parse).then((installedGames) => {
|
||||
loot.installedGames = installedGames;
|
||||
loot.DOM.updateEnabledGames(installedGames);
|
||||
if (installedGames.length > 0) {
|
||||
loot.DOM.enableGameOperations(true);
|
||||
}
|
||||
}).catch(loot.handlePromiseError)
|
||||
.then(() => {
|
||||
loot.settings = settings;
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
function handleInitErrors(error) {
|
||||
dom.listInitErrors(getErrorMessages(error.message));
|
||||
Dialog.closeProgress();
|
||||
dom.enableGameOperations(false);
|
||||
dom.openDialog('settingsDialog');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user