Skip to content

Commit

Permalink
Set expireTimer to null to unset
Browse files Browse the repository at this point in the history
// FREEBIE
  • Loading branch information
liliakai committed Feb 22, 2017
1 parent 0fac2e1 commit 6509646
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/models/conversations.js
Expand Up @@ -199,6 +199,7 @@
},

updateExpirationTimer: function(expireTimer, source, received_at) {
if (!expireTimer) { expireTimer = null; }
source = source || textsecure.storage.user.getNumber();
var timestamp = received_at || Date.now();
this.save({ expireTimer: expireTimer });
Expand Down
2 changes: 1 addition & 1 deletion js/models/messages.js
Expand Up @@ -424,7 +424,7 @@
message.get('received_at'));
}
} else if (conversation.get('expireTimer')) {
conversation.updateExpirationTimer(0, source,
conversation.updateExpirationTimer(null, source,
message.get('received_at'));
}
}
Expand Down
4 changes: 3 additions & 1 deletion js/views/conversation_view.js
Expand Up @@ -32,8 +32,10 @@
},
setTimer: function(e) {
var seconds = this.$(e.target).data().seconds;
if (seconds >= 0) {
if (seconds > 0) {
this.model.updateExpirationTimer(seconds);
} else {
this.model.updateExpirationTimer(null);
}
},
render: function() {
Expand Down

0 comments on commit 6509646

Please sign in to comment.