Skip to content

Commit 1f15e64

Browse files
committed
refactor: use INITIAL_APP_DATA for handleLogout in MainMenu.tsx
- Replaced manual scene update with a reference to INITIAL_APP_DATA for cleaner state management. - This change enhances maintainability and ensures consistency with the initialized app data structure.
1 parent 556193c commit 1f15e64

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/frontend/src/ui/MainMenu.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useLogout } from '../hooks/useLogout';
1111
import { useAuthStatus } from '../hooks/useAuthStatus';
1212
import { ExcalidrawElementFactory, PlacementMode } from '../lib/elementFactory';
1313
import "./MainMenu.scss";
14-
14+
import { INITIAL_APP_DATA } from '../constants';
1515
// Function to generate gravatar URL
1616
const getGravatarUrl = (email: string, size = 32) => {
1717
const hash = md5(email.toLowerCase().trim()).toString();
@@ -188,11 +188,8 @@ export const MainMenuConfig: React.FC<MainMenuConfigProps> = ({
188188
}
189189
});
190190

191-
excalidrawAPI.updateScene({
192-
appState: {},
193-
elements: [],
194-
files: [],
195-
});
191+
excalidrawAPI.updateScene(INITIAL_APP_DATA);
192+
196193
};
197194

198195
return (

0 commit comments

Comments
 (0)