Fix sorting errors

This commit is contained in:
Oliver Hamlet
2016-06-21 20:08:40 +01:00
parent a353f91326
commit 469f013bf8
2 changed files with 5 additions and 5 deletions
+3 -2
View File
@@ -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);
+2 -3
View File
@@ -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);