Explorar o código

Don't save a draft if the card description hasn't been modified

Maxime Quandalle %!s(int64=9) %!d(string=hai) anos
pai
achega
9efd565f74
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      client/components/cards/cardDetails.js

+ 4 - 1
client/components/cards/cardDetails.js

@@ -88,7 +88,10 @@ BlazeComponent.extendComponent({
 
   close(isReset = false) {
     if (this.isOpen.get() && ! isReset) {
-      UnsavedEdits.set(this._getUnsavedEditKey(), this.getValue());
+      let draft = $.trim(this.getValue());
+      if (draft !== Cards.findOne(Session.get('currentCard')).description) {
+        UnsavedEdits.set(this._getUnsavedEditKey(), this.getValue());
+      }
     }
     super();
   }