Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Remove try/catch block in localstorage call
Browse files Browse the repository at this point in the history
  • Loading branch information
gefgu committed Sep 8, 2022
1 parent 55dd973 commit 50f1a55
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/views/spaces/SpacePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,8 @@ const InnerSpacePanel = React.memo<IInnerSpacePanelProps>(({
const SpacePanel = () => {
const [isPanelCollapsed, setPanelCollapsed] = useState(() => {
const defaultValue = true;

try {
const item = window.localStorage.getItem(KEY_PANEL_IS_COLLAPSED);
return item ? JSON.parse(item) : defaultValue;
} catch (error) {
return defaultValue;
}
const item = window.localStorage.getItem(KEY_PANEL_IS_COLLAPSED);
return item ? JSON.parse(item) : defaultValue;
});

const ref = useRef<HTMLDivElement>();
Expand Down

0 comments on commit 50f1a55

Please sign in to comment.