more tweaks to the chat dropdown -- handling null case -- issue #615

v1.18.x
Julian Lam 11 years ago
parent 030ce95dea
commit 4819bea378

@ -190,6 +190,7 @@
numChats = chats.length, numChats = chats.length,
x, userObj; x, userObj;
if (numChats > 0) {
for(x=0;x<numChats;x++) { for(x=0;x<numChats;x++) {
userObj = chats[x]; userObj = chats[x];
chatEl.setAttribute('data-uid', userObj.uid); chatEl.setAttribute('data-uid', userObj.uid);
@ -197,10 +198,13 @@
chatsFrag.appendChild(chatEl.cloneNode(true)); chatsFrag.appendChild(chatEl.cloneNode(true));
} }
} else {
chatEl.innerHTML = '<a href="#">No Recent Chats</a>';
chatsFrag.appendChild(chatEl.cloneNode(true));
}
chatsListEl.empty(); chatsListEl.empty();
chatsListEl.html(chatsFrag); chatsListEl.html(chatsFrag);
// console.log('received chats: ', chats);
}); });
}); });

Loading…
Cancel
Save