From fee2ba5eb1cf89f6894318411408055a64b6c608 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Fri, 28 Jun 2024 10:17:47 +0530 Subject: [PATCH] removes removing of logs --- v2/src/components/utils.ts | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/v2/src/components/utils.ts b/v2/src/components/utils.ts index 3c15afa27..ce9f79ad4 100644 --- a/v2/src/components/utils.ts +++ b/v2/src/components/utils.ts @@ -81,20 +81,20 @@ export function recursiveMap(children: any, fn: any, filterDescendants?: (comp: export const recursiveMapAllChildren = ( children: any, fn: (child: React.ReactElement) => React.ReactElement - ): any => { +): any => { let result = React.Children.map(children, child => { - if (!React.isValidElement(child)) { - return child; - } - - if ((child as React.ReactElement).props.children) { - const props = { - children: recursiveMapAllChildren((child as React.ReactElement).props.children, fn) + if (!React.isValidElement(child)) { + return child; + } + + if ((child as React.ReactElement).props.children) { + const props = { + children: recursiveMapAllChildren((child as React.ReactElement).props.children, fn) + } + child = React.cloneElement(child, props); } - child = React.cloneElement(child, props); - } - - return fn(child); + + return fn(child); }); if (result.length === 1) { if (children.props === undefined || children.props.children === undefined || @@ -103,7 +103,7 @@ export const recursiveMapAllChildren = ( } } return result - } +} export function mockDelay(timeout = 2000) { return new Promise(resolve => setTimeout(resolve, timeout)); @@ -151,7 +151,6 @@ export async function sendSDKLogsToBackend() { if (isDev()) { console.log(parsedSDKLogs, "auth_error_sdk_logs"); - localStorage.removeItem(SDK_LOGS_STORAGE_KEY); } else { await axios .post( @@ -169,8 +168,5 @@ export async function sendSDKLogsToBackend() { }, {} ) - .then(() => { - localStorage.removeItem(SDK_LOGS_STORAGE_KEY); - }); } } \ No newline at end of file