From 469f013bf857973229043c571e6c78cb26784246 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Tue, 21 Jun 2016 20:08:40 +0100 Subject: [PATCH] Fix sorting errors --- src/gui/html/js/events.js | 5 +++-- src/gui/html/js/game.js | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/html/js/events.js b/src/gui/html/js/events.js index ba6fc6ce..5b5ae282 100644 --- a/src/gui/html/js/events.js +++ b/src/gui/html/js/events.js @@ -140,7 +140,7 @@ function onSortPlugins() { loot.Dialog.showNotification(loot.l10n.translate('Sorting made no changes to the load order.')); return; } - loot.game.updatePlugins(result.plugins); + loot.game.setSortedPlugins(result.plugins); /* Now update the UI for the new order. */ loot.filters.apply(loot.game.plugins); @@ -159,7 +159,8 @@ function onApplySort() { }).catch(loot.handlePromiseError); } function onCancelSort() { - return loot.query('cancelSort').then(JSON.parse).then(loot.game.cancelSort).then(() => { + return loot.query('cancelSort').then(JSON.parse).then((globalMessages) => { + loot.game.cancelSort(globalMessages); /* Sort UI elements again according to stored old load order. */ loot.filters.apply(loot.game.plugins); diff --git a/src/gui/html/js/game.js b/src/gui/html/js/game.js index e04d127b..d9f48d06 100644 --- a/src/gui/html/js/game.js +++ b/src/gui/html/js/game.js @@ -305,12 +305,12 @@ } applySort() { - delete this.oldLoadOrder; + this.oldLoadOrder = undefined; } cancelSort(globalMessages) { this.plugins = this.oldLoadOrder; - delete this.oldLoadOrder; + this.oldLoadOrder = undefined; /* Update general messages */ this.globalMessages = globalMessages; @@ -321,7 +321,6 @@ plugins.forEach((plugin) => { const existingPlugin = this.plugins.find(item => item.name === plugin.name); if (existingPlugin) { - //delete existingPlugin.userlist; existingPlugin.userlist = undefined; existingPlugin.update(plugin);