Skip to content

Commit

Permalink
removes removing of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Jun 28, 2024
1 parent 59ebc6f commit fee2ba5
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions v2/src/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -103,7 +103,7 @@ export const recursiveMapAllChildren = (
}
}
return result
}
}

export function mockDelay(timeout = 2000) {
return new Promise(resolve => setTimeout(resolve, timeout));
Expand Down Expand Up @@ -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(
Expand All @@ -169,8 +168,5 @@ export async function sendSDKLogsToBackend() {
},
{}
)
.then(() => {
localStorage.removeItem(SDK_LOGS_STORAGE_KEY);
});
}
}

0 comments on commit fee2ba5

Please sign in to comment.