From d0dbd5312a0a22f160c3ad6a53dffce9a65acdbc Mon Sep 17 00:00:00 2001 From: suziwen Date: Thu, 15 Aug 2024 08:29:17 +0800 Subject: [PATCH] No need to save or revert when nothing changes. --- omega-web/src/omega/controllers/master.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/omega-web/src/omega/controllers/master.coffee b/omega-web/src/omega/controllers/master.coffee index 7e3f8b3..7ab5af3 100644 --- a/omega-web/src/omega/controllers/master.coffee +++ b/omega-web/src/omega/controllers/master.coffee @@ -26,7 +26,8 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window, showFirstRun() $rootScope.revertOptions = -> - $window.location.reload() + if $rootScope.optionsDirty + $window.location.reload() $rootScope.exportScript = (name) -> getProfileName = @@ -85,6 +86,7 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window, return true $rootScope.applyOptions = -> + return unless $rootScope.optionsDirty return unless checkFormValid() return if $rootScope.$broadcast('omegaApplyOptions').defaultPrevented plainOptions = angular.fromJson(angular.toJson($rootScope.options))