Browse Source

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

Maxime Quandalle 9 years ago
parent
commit
9efd565f74
1 changed files with 4 additions and 1 deletions
  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();
   }