1
0
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:
Loic Blot
2018-09-08 00:52:08 +02:00
committed by Loïc Blot
parent 267872b396
commit f034644459
4 changed files with 30 additions and 5 deletions
+7 -1
View File
@@ -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
+6
View File
@@ -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();
});
}
}
});