mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Wrap localStorage API Access in try-catch (#1241)
This commit is contained in:
parent
2cc1105ff5
commit
22160f50d3
2 changed files with 29 additions and 12 deletions
|
@ -81,8 +81,12 @@ export class TopErrorBoundary extends React.Component<
|
|||
{t("errorSplash.clearCanvasMessage")}
|
||||
<button
|
||||
onClick={() => {
|
||||
localStorage.clear();
|
||||
window.location.reload();
|
||||
try {
|
||||
localStorage.clear();
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t("errorSplash.clearCanvasMessage_button")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue