소스 검색

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

Maxime Quandalle 9 년 전
부모
커밋
9efd565f74
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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();
   }