This commit is contained in:
Mirco Wittrien 2019-09-06 10:10:43 +02:00
parent a5310008f2
commit 3e805ace2f
2 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -1095,7 +1095,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
var key = keys[i];
var value = instance[key];
var statenode = instance.stateNode ? instance.stateNode : (instance.return ? instance.return.stateNode : null);
if (statenode && !Node.prototype.isPrototypeOf(statenode) && (instance.type && config.name && config.name.some(name => instance.type.displayName === name.split(' _ _ ')[0] || instance.type.name === name.split(' _ _ ')[0]) || config.props && config.props.every(prop => statenode[prop] !== undefined) || config.defaultProps && config.defaultProps.every(prop => statenode[prop] !== undefined))) {
if (statenode && !Node.prototype.isPrototypeOf(statenode) && (instance.type && config.name && config.name.some(name => instance.type.displayName === name.split(' _ _ ')[0] || instance.type.name === name.split(' _ _ ')[0]) || config.props && config.props.every(prop => statenode[prop] !== undefined) || config.defaultProps && config.defaultProps.every(prop => statenode[prop] !== undefined))) {
if (config.all === undefined || !config.all) result = statenode;
else if (config.all) {
if (config.noCopies === undefined || !config.noCopies || config.noCopies && !statenode.BDFDBreactSearch) {
@ -1103,7 +1103,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
if (config.group) {
if (config.name && instance.type && (instance.type.displayName || instance.type.name)) {
var group = 'Default';
for (let name of config.name) if (instance.type.displayName === name.split(' _ _ ')[0] || instance.type.name === name.split(' _ _ ')[0]) {
for (let name of config.name) if (instance.type.displayName === name.split(' _ _ ')[0] || instance.type.name === name.split(' _ _ ')[0]) {
group = name;
break;
}
@ -1463,17 +1463,17 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
for (let type in plugin.patchModules) {
var mapped = webModulesPatchmap[type];
var classOrBoolean = webModulesNotFindableModules[type];
var patchtype = mapped ? mapped + ' _ _ ' + type : type;
var patchtype = mapped ? mapped + ' _ _ ' + type : type;
if (mapped) {
plugin.patchModules[patchtype] = plugin.patchModules[type];
delete plugin.patchModules[type];
}
if (!classOrBoolean) patchInstance(BDFDB.WebModules.findByName(patchtype.split(' _ _ ')[0]), patchtype);
if (!classOrBoolean) patchInstance(BDFDB.WebModules.findByName(patchtype.split(' _ _ ')[0]), patchtype);
else if (typeof classOrBoolean == 'boolean' || DiscordClasses[classOrBoolean]) checkForInstance(classOrBoolean, patchtype);
}
function patchInstance(instance, type) {
if (instance) {
var name = type.split(' _ _ ')[0];
var name = type.split(' _ _ ')[0];
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
instance = instance.displayName == name ? instance : BDFDB.getOwnerInstance({instance, name, up:true});
if (instance) {