Both UI timer and database timer will remove expired message
This commit is contained in:
parent
9f920aa35b
commit
37f3054976
4 changed files with 26 additions and 6 deletions
|
@ -15,6 +15,7 @@
|
|||
this.listenTo(this.model, 'change', this.onChange);
|
||||
this.listenTo(this.model, 'destroy', this.onDestroy);
|
||||
this.listenTo(this.model, 'unload', this.onUnload);
|
||||
this.listenTo(this.model, 'expired', this.onExpired);
|
||||
},
|
||||
onChange() {
|
||||
this.addId();
|
||||
|
@ -27,6 +28,9 @@
|
|||
const { id } = this.model;
|
||||
this.$el.attr('id', id);
|
||||
},
|
||||
onExpired() {
|
||||
setTimeout(() => this.onUnload(), 1000);
|
||||
},
|
||||
onUnload() {
|
||||
if (this.childView) {
|
||||
this.childView.remove();
|
||||
|
@ -93,6 +97,7 @@
|
|||
};
|
||||
|
||||
this.listenTo(this.model, 'change', update);
|
||||
this.listenTo(this.model, 'expired', update);
|
||||
|
||||
this.conversation = this.model.getConversation();
|
||||
this.listenTo(this.conversation, 'change', update);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue