From 47c8c0715d6415d2dc49b09b32015f82fc641bb5 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 9 Jan 2016 11:27:47 +0000 Subject: [PATCH] Don't ask to apply an unchanged load order Instead, notify that no changes were made. Closes #523. --- src/gui/html/js/events.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/html/js/events.js b/src/gui/html/js/events.js index f96f163c..8e835446 100644 --- a/src/gui/html/js/events.js +++ b/src/gui/html/js/events.js @@ -129,6 +129,18 @@ function onSortPlugins() { if (!result) { return; } + /* Check if sorted load order differs from current load order. */ + const loadOrderIsUnchanged = result.every((plugin, index) => { + return plugin.name === loot.game.plugins[index].name; + }); + if (loadOrderIsUnchanged) { + /* Send cancelSort query to notify that no unapplied sorting changes are + present. Not doing so prevents LOOT's window from closing. */ + loot.query('cancelSort'); + loot.Dialog.closeProgress(); + loot.Dialog.showNotification(loot.l10n.translate('Sorting made no changes to the load order.')); + return; + } loot.game.oldLoadOrder = loot.game.plugins; loot.game.loadOrder = []; result.forEach((plugin) => {