mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +00:00
fix some code issues
This commit is contained in:
parent
c8deb8df6e
commit
3a3a62b24f
@ -35,9 +35,9 @@ var ContactList = new Vue({
|
||||
// Now bind the events when we click on the phone number
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/peerlist'), function (jsondata, status) {
|
||||
// Use a buffer for better jQuery performance
|
||||
var bufferedContacts = [];
|
||||
let bufferedContacts = [];
|
||||
|
||||
Sms.photoVersion = jsondata["photo_version"];
|
||||
Sms.photoVersion = jsondata["photo_version"];
|
||||
|
||||
$.each(jsondata['phonelist'], function (id, val) {
|
||||
var peerLabel;
|
||||
@ -144,11 +144,11 @@ var ContactList = new Vue({
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/new_messages'),
|
||||
{'lastDate': this.lastRetrievedMessageDate},
|
||||
function (jsondata, status) {
|
||||
var bufferedContacts = [];
|
||||
let bufferedContacts = [];
|
||||
|
||||
$.each(jsondata['phonelist'], function (id, val) {
|
||||
var fn, peerLabel;
|
||||
if (typeof jsondata['contacts'][id] === 'undefined') {
|
||||
$.each(jsondata['phonelist'], function (id, val) {
|
||||
let fn, peerLabel;
|
||||
if (typeof jsondata['contacts'][id] === 'undefined') {
|
||||
peerLabel = id;
|
||||
}
|
||||
else {
|
||||
@ -157,13 +157,13 @@ var ContactList = new Vue({
|
||||
}
|
||||
|
||||
if (!inArray(peerLabel, bufferedContacts)) {
|
||||
var contactObj = {
|
||||
'label': peerLabel,
|
||||
'nav': id,
|
||||
'unread': parseInt(val)
|
||||
};
|
||||
let contactObj = {
|
||||
'label': peerLabel,
|
||||
'nav': id,
|
||||
'unread': parseInt(val)
|
||||
};
|
||||
|
||||
if (typeof jsondata['photos'][peerLabel] !== 'undefined') {
|
||||
if (typeof jsondata['photos'][peerLabel] !== 'undefined') {
|
||||
contactObj.avatar = jsondata['photos'][peerLabel];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user