mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-26 22:54:45 +00:00
add a hack to not open DM related modals until twister.DMs will be initializated
This commit is contained in:
parent
cecd428e5d
commit
fd4a62740a
@ -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) {
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($.isEmptyObject(twister.DMs)) {
|
||||
setTimeout(openGroupMessagesModal, 1000, groupAlias);
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof groupAlias === 'undefined') {
|
||||
var modal = openModal({
|
||||
classAdd: 'directMessages groupMessages',
|
||||
|
Loading…
x
Reference in New Issue
Block a user