Avoid committing more than once when restoring removed modules

This commit is contained in:
DarkPhoenix
2019-04-20 23:10:36 +03:00
parent 9eaeb60af7
commit 44240c1d37

View File

@@ -45,7 +45,8 @@ class CalcRemoveLocalModulesCommand(wx.Command):
results = []
from .localReplace import CalcReplaceLocalModuleCommand
for position, modInfo in self.savedModInfos.items():
cmd = CalcReplaceLocalModuleCommand(fitID=self.fitID, position=position, newModInfo=modInfo, commit=self.commit)
# Do not commit in any case to not worsen performance, we will commit later anyway
cmd = CalcReplaceLocalModuleCommand(fitID=self.fitID, position=position, newModInfo=modInfo, commit=False)
results.append(cmd.Do())
if not any(results):
return False