Merge pull request #23201 from civicrm/5.49
[civicrm-core.git] / ang / crmMailing / EditMailingCtrl.js
index 5651d4f8d6a31fe058c30d848bd7abc926a09fec..7e72365116ec63b4539f2dff6e4d5739e1ce025a 100644 (file)
         return true;
       },
       model: function() {
-        return [$scope.mailing, $scope.attachments.getAutosaveSignature()];
+        //modified date is unset so that it gets ignored in comparison
+        //its value is overwritten with the save response from the server and may differ from the local value,
+        //which would result in an unnecessary auto-save
+        var mailing = angular.copy($scope.mailing);
+        mailing.modified_date = undefined;
+        return [mailing, $scope.attachments.getAutosaveSignature()];
       },
       form: function() {
         return $scope.crmMailing;