1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 16:06:15 +00:00

fix some code issues

This commit is contained in:
Loic Blot 2018-11-10 17:38:50 +01:00
parent c8deb8df6e
commit 3a3a62b24f
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987

View File

@ -35,7 +35,7 @@ var ContactList = new Vue({
// Now bind the events when we click on the phone number // Now bind the events when we click on the phone number
$.getJSON(Sms.generateURL('/front-api/v1/peerlist'), function (jsondata, status) { $.getJSON(Sms.generateURL('/front-api/v1/peerlist'), function (jsondata, status) {
// Use a buffer for better jQuery performance // Use a buffer for better jQuery performance
var bufferedContacts = []; let bufferedContacts = [];
Sms.photoVersion = jsondata["photo_version"]; Sms.photoVersion = jsondata["photo_version"];
@ -144,10 +144,10 @@ var ContactList = new Vue({
$.getJSON(Sms.generateURL('/front-api/v1/new_messages'), $.getJSON(Sms.generateURL('/front-api/v1/new_messages'),
{'lastDate': this.lastRetrievedMessageDate}, {'lastDate': this.lastRetrievedMessageDate},
function (jsondata, status) { function (jsondata, status) {
var bufferedContacts = []; let bufferedContacts = [];
$.each(jsondata['phonelist'], function (id, val) { $.each(jsondata['phonelist'], function (id, val) {
var fn, peerLabel; let fn, peerLabel;
if (typeof jsondata['contacts'][id] === 'undefined') { if (typeof jsondata['contacts'][id] === 'undefined') {
peerLabel = id; peerLabel = id;
} }
@ -157,7 +157,7 @@ var ContactList = new Vue({
} }
if (!inArray(peerLabel, bufferedContacts)) { if (!inArray(peerLabel, bufferedContacts)) {
var contactObj = { let contactObj = {
'label': peerLabel, 'label': peerLabel,
'nav': id, 'nav': id,
'unread': parseInt(val) 'unread': parseInt(val)