From 022c87f3c7384f71edae9b0e13aa902f19e31094 Mon Sep 17 00:00:00 2001 From: Pedro Lopez Date: Wed, 1 Sep 2021 09:18:34 -0400 Subject: [PATCH] optionally patch _find function if it's not found --- src/util/Injected.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/Injected.js b/src/util/Injected.js index 7697078..53b39bd 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -38,12 +38,14 @@ exports.ExposeStore = (moduleRaidStr) => { window.Store.DownloadManager = window.mR.findModule('DownloadManager')[0].default; window.Store.Call = window.mR.findModule('CallCollection')[0].default; - window.Store.Chat._find = e => { - const target = window.Store.Chat.get(e); - return target ? Promise.resolve(target) : Promise.resolve({ - id: e - }); - }; + if(!window.Store.Chat._find) { + window.Store.Chat._find = e => { + const target = window.Store.Chat.get(e); + return target ? Promise.resolve(target) : Promise.resolve({ + id: e + }); + }; + } }; exports.LoadUtils = () => {