Refresh content if game is configured in settings

After a failed initialisation.
This commit is contained in:
Oliver Hamlet
2017-01-05 21:15:49 +00:00
parent 69ccd5bbf5
commit 2a32890054
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -98,6 +98,10 @@ void LootState::load(YAML::Node& settings) {
++it;
}
if (currentGame_ == end(games_)) {
selectGame("");
}
// Re-initialise the current game in case the game path setting was changed.
currentGame_->Init(true);
// Update game path in settings object.
+6
View File
@@ -323,6 +323,12 @@ function onCloseSettingsDialog(evt) {
loot.DOM.updateEnabledGames(loot.installedGames);
loot.DOM.updateSelectedGame(loot.game.folder);
})
.then(() => {
if (loot.game.folder.length === 0) {
/* Initialisation failed and game was configured in settings. */
onContentRefresh();
}
})
.catch(loot.handlePromiseError);
}
function onEditorOpen(evt) {