Don't act on the changeGame event during init

The event is fired when setting the initial game menu selection, before
the game data is loaded, so there's no point processing the event.
This commit is contained in:
Oliver Hamlet
2016-09-10 17:00:15 +01:00
parent f977592c66
commit 624a7585b9
+3 -1
View File
@@ -37,7 +37,9 @@ function onConflictsFilter(evt) {
}
function onChangeGame(evt) {
if (evt.detail.item.getAttribute('value') === loot.game.folder) {
if (evt.detail.item.getAttribute('value') === loot.game.folder
|| loot.game.folder.length === 0) {
// Game folder length is zero if LOOT is being initalised.
return;
}
/* Send off a CEF query with the folder name of the new game. */