소스 검색

fix: #5622 - prevent session theme reset during collaboration (#5640)

* ✅ fixed #5622 - prevent session theme reset

 - ❌ prevent newly initialized state to override theme preferences.
 - 🔧 fix for #5622

* refactor

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
Abdullah Adeel 2 년 전
부모
커밋
b3052f0178
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      src/excalidraw-app/index.tsx

+ 7 - 1
src/excalidraw-app/index.tsx

@@ -194,7 +194,13 @@ const initializeScene = async (opts: {
       scene: {
         ...scene,
         appState: {
-          ...restoreAppState(scene?.appState, excalidrawAPI.getAppState()),
+          ...restoreAppState(
+            {
+              ...scene?.appState,
+              theme: localDataState?.appState?.theme || scene?.appState?.theme,
+            },
+            excalidrawAPI.getAppState(),
+          ),
           // necessary if we're invoking from a hashchange handler which doesn't
           // go through App.initializeScene() that resets this flag
           isLoading: false,