Browse Source

add a hack to not open DM related modals until twister.DMs will be initializated

readme-update
Simon Grim 6 years ago
parent
commit
fd4a62740a
  1. 15
      js/twister_directmsg.js

15
js/twister_directmsg.js

@ -68,6 +68,11 @@ function openCommonDMsModal() { @@ -68,6 +68,11 @@ function openCommonDMsModal() {
return;
}
if ($.isEmptyObject(twister.DMs)) {
setTimeout(openCommonDMsModal, 1000);
return;
}
var modal = openModal({
classAdd: 'directMessages',
content: twister.tmpl.commonDMsList.clone(true),
@ -94,6 +99,11 @@ function openDmWithUserModal(peerAlias) { @@ -94,6 +99,11 @@ function openDmWithUserModal(peerAlias) {
return;
}
if ($.isEmptyObject(twister.DMs)) {
setTimeout(openDmWithUserModal, 1000, peerAlias);
return;
}
var modal = openModal({
classAdd: 'directMessages',
content: $('.messages-thread-template').children().clone(true),
@ -134,6 +144,11 @@ function openGroupMessagesModal(groupAlias) { @@ -134,6 +144,11 @@ function openGroupMessagesModal(groupAlias) {
return;
}
if ($.isEmptyObject(twister.DMs)) {
setTimeout(openGroupMessagesModal, 1000, groupAlias);
return;
}
if (typeof groupAlias === 'undefined') {
var modal = openModal({
classAdd: 'directMessages groupMessages',

Loading…
Cancel
Save