Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a57cef

Browse files
fix: add error handling for localStorage set operation.
1 parent 4399966 commit 2a57cef

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/features/debugger/components/steps/debugger-steps.component.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ export const DebuggerSteps = () => {
133133
authCode: null,
134134
stateToken: null,
135135
};
136-
localStorage.setItem(
137-
"app-state",
138-
JSON.stringify({ ...restartDebuggerStepsData, ...restartAuthData }),
139-
);
136+
try {
137+
localStorage.setItem(
138+
"app-state",
139+
JSON.stringify({ ...restartDebuggerStepsData, ...restartAuthData }),
140+
);
141+
} catch {}
140142
setAuthData(restartAuthData)
141143
setDebuggerStepsData(restartDebuggerStepsData)
142144
setCurrentStepIndex(0)

0 commit comments

Comments
 (0)