瀏覽代碼

load scene from localStorage in collaboration if user is first… (#1036)

* load scene from localStorage in collaboration if user is first in room

* load scene from localStorage in collaboration prior to syncing with server

* fix merge

Co-authored-by: dwelle <luzar.david@gmail.com>
Edwin Lin 5 年之前
父節點
當前提交
f1160a1534
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 3 2
      src/components/App.tsx
  2. 1 1
      src/i18n.ts

+ 3 - 2
src/components/App.tsx

@@ -351,13 +351,14 @@ export class App extends React.Component<any, AppState> {
       return;
     }
 
+    const scene = await loadScene(null);
+    this.syncActionResult(scene);
+
     const roomMatch = getCollaborationLinkData(window.location.href);
     if (roomMatch) {
       this.initializeSocketClient();
       return;
     }
-    const scene = await loadScene(null);
-    this.syncActionResult(scene);
 
     window.addEventListener("beforeunload", this.beforeUnload);
   }

+ 1 - 1
src/i18n.ts

@@ -10,7 +10,7 @@ export const languages = [
     label: "Bahasa Indonesia",
     data: require("./locales/id-ID.json"),
   },
-  { lng: "hu-HU", label: "Magyar", data: require("./locales/hu-HU.json") },  
+  { lng: "hu-HU", label: "Magyar", data: require("./locales/hu-HU.json") },
   { lng: "no-No", label: "Norsk", data: require("./locales/no-NO.json") },
   { lng: "pl-PL", label: "Polski", data: require("./locales/pl-PL.json") },
   { lng: "pt-PT", label: "Português", data: require("./locales/pt-PT.json") },