diff options
-rw-r--r-- | src/client/views/Main.tsx | 12 | ||||
-rw-r--r-- | src/server/authentication/controllers/WorkspacesMenu.tsx | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 90ce8be1a..d4bfbb52a 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -40,10 +40,11 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { let mainDocId: string; request.get(window.location.origin + "/getActiveWorkspaceId", (error, response, body) => { const here = window.location.origin; + let workspaceId: string; if (body) { - mainDocId = body; + workspaceId = body; } else { - mainDocId = Utils.GenerateGuid(); + workspaceId = Utils.GenerateGuid(); request.post(here + "/addWorkspaceId", { body: { target: mainDocId @@ -57,9 +58,14 @@ request.get(window.location.origin + "/getActiveWorkspaceId", (error, response, json: true }) } - init(); + load(workspaceId); }) +function load(workspaceId: string) { + mainDocId = workspaceId; + init(); +} + //runInAction(() => // let doc1 = Documents.TextDocument({ title: "hello" }); // let doc2 = doc1.MakeDelegate(); diff --git a/src/server/authentication/controllers/WorkspacesMenu.tsx b/src/server/authentication/controllers/WorkspacesMenu.tsx index a440ab779..b1125384e 100644 --- a/src/server/authentication/controllers/WorkspacesMenu.tsx +++ b/src/server/authentication/controllers/WorkspacesMenu.tsx @@ -39,6 +39,7 @@ export class WorkspacesMenu extends React.Component { } setWorkspaceId = (e: React.MouseEvent) => { + //Main.load(e.currentTarget.innherHTML) console.log(e.currentTarget.innerHTML); } |