This commit is contained in:
Mirco Wittrien 2020-02-13 11:48:28 +01:00
parent 2d683dd899
commit 11c728c421
3 changed files with 3 additions and 4 deletions

View File

@ -1206,7 +1206,7 @@
}
else delete module.BDFDBpatch[funcName][type];
}
if (!BDFDB.ObjectUtils.toArray(module.BDFDBpatch[funcName]).some(patchObj => !BDFDB.ObjectUtils.isEmpty(patchObj))) {
if (!BDFDB.ObjectUtils.toArray(module.BDFDBpatch[funcName]).some(patchObj => BDFDB.ObjectUtils.is(patchObj) && !BDFDB.ObjectUtils.isEmpty(patchObj))) {
module[funcName] = module.BDFDBpatch[funcName].originalMethod;
delete module.BDFDBpatch[funcName];
if (BDFDB.ObjectUtils.isEmpty(module.BDFDBpatch)) delete module.BDFDBpatch;

File diff suppressed because one or more lines are too long

View File

@ -180,9 +180,8 @@ var GoogleTranslateOption = (_ => {
}));
let text = document.getSelection().toString();
if (text) {
let GSRstring = BDFDB.ReactUtils.getValue(BDFDB.BDUtils.getPlugin("GoogleSearchReplace", true), "labels.context_googlesearchreplace_text");
let translating, foundtranslation, foundinput, foundoutput;
let [children2, index2] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"SearchWithGoogle", props: GSRstring ? [["label", GSRstring]] : null});
let [children2, index2] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"SearchWithGoogle"});
if (index2 > -1) children2.splice(index2 > -1 ? index2 : children2.length, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Item, {
label: this.labels.context_googletranslateoption_text,
disabled: isTranslating,