Update BDFDB.js
This commit is contained in:
parent
29cdae46c2
commit
013a4203b4
|
@ -1966,6 +1966,23 @@
|
|||
}
|
||||
};
|
||||
|
||||
BDFDB.MessageUtils = {};
|
||||
BDFDB.MessageUtils.rerenderAll = function () {
|
||||
let MessagesIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"Messages", unlimited:true});
|
||||
let MessagesPrototype = BDFDB.ReactUtils.getValue(MessagesIns, "_reactInternalFiber.type.prototype");
|
||||
if (MessagesIns && MessagesPrototype) {
|
||||
let patchCancel = BDFDB.ModuleUtils.patch(BDFDB, MessagesPrototype, "render", {after:e => {
|
||||
patchCancel();
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {props: ["message", "channel"]});
|
||||
if (index > -1) {
|
||||
for (let i in children) children[i] = null;
|
||||
BDFDB.ReactUtils.forceUpdate(MessagesIns);
|
||||
}
|
||||
}});
|
||||
BDFDB.ReactUtils.forceUpdate(MessagesIns);
|
||||
}
|
||||
};
|
||||
|
||||
BDFDB.UserUtils = {};
|
||||
var myDataUser = LibraryModules.CurrentUserStore ? LibraryModules.CurrentUserStore.getCurrentUser() : null;
|
||||
BDFDB.UserUtils.is = function (user) {
|
||||
|
|
Loading…
Reference in New Issue