mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-11 16:32:55 +00:00
Add a button to wipe all messages
This commit is contained in:
@@ -18,12 +18,18 @@ var ContactList = new Vue({
|
||||
lastTotalUnreadCount: 0
|
||||
},
|
||||
created: function () {
|
||||
this.contacts = [];
|
||||
this.reset();
|
||||
this.fetch();
|
||||
this.checkNewMessages();
|
||||
setInterval(this.checkNewMessages, 10000);
|
||||
},
|
||||
methods: {
|
||||
reset: function () {
|
||||
this.contacts = [];
|
||||
this.lastRetrievedMessageDate = 0;
|
||||
this.totalUnreadMessages = 0;
|
||||
this.lastTotalUnreadCount = 0;
|
||||
},
|
||||
fetch: function () {
|
||||
var self = this;
|
||||
// Now bind the events when we click on the phone number
|
||||
|
||||
@@ -70,6 +70,12 @@ var SmsSettings = new Vue({
|
||||
'country': self.country
|
||||
}
|
||||
);
|
||||
},
|
||||
wipeAllMessages: function () {
|
||||
$.post(Sms.generateURL('/front-api/v1/delete/all'), {}, function () {
|
||||
ContactList.reset();
|
||||
Conversation.clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user