From 624a7585b98fdcba14e97379b29463ebfc048692 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 10 Sep 2016 17:00:15 +0100 Subject: [PATCH] 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. --- src/gui/html/js/events.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/html/js/events.js b/src/gui/html/js/events.js index 8a1f08a2..47f6a92f 100644 --- a/src/gui/html/js/events.js +++ b/src/gui/html/js/events.js @@ -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. */