From 850fadfaba3dc5c4b5c1f182248d52f3777472e5 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:10:28 -0500 Subject: [PATCH] Temp Fix ExportContacts --- src/equicordplugins/exportContacts/index.tsx | 25 +++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/equicordplugins/exportContacts/index.tsx b/src/equicordplugins/exportContacts/index.tsx index 8f3da9b3..acb5ed5e 100644 --- a/src/equicordplugins/exportContacts/index.tsx +++ b/src/equicordplugins/exportContacts/index.tsx @@ -68,17 +68,20 @@ export default definePlugin({ }, { find: "[role=\"tab\"][aria-disabled=\"false\"]", - replacement: { - match: /this\.props;return\(/, - replace: "this.props;console.log(a.Children);return(" - } - }, - { - find: "[role=\"tab\"][aria-disabled=\"false\"]", - replacement: { - match: /(\w+)\.Children\.map\((\w+),\s*this\.renderChildren\)/, - replace: "[...$1.Children.map($2,this.renderChildren),$self.addExportButton()]" - } + replacement: [ + { + match: /this\.props;(return\(.*?"aria-label":(\i))/, + replace: "this.props;console.log($2?.Children);$1" + }, + { + match: /("aria-label":(\i),children:)(\w+)\.Children\.map\((\w+),\s*this\.renderChildren\)/, + replace: + "$1($3 && $3.Children ?" + + "($2 === 'Friends' ?" + + "[...$3.Children.map($4, this.renderChildren), $self.addExportButton()]" + + ": [...$3.Children.map($4, this.renderChildren)]) : $3.map($4, this.renderChildren))" + } + ] } ],