aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-02-27 12:53:49 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-02-27 12:53:49 -0500
commitdd6c727f9d7836d2d86a9a1e7026eb694eaba500 (patch)
treedd97c7d109025e0be90e74d1070acdfe5eec7ced
parent23a8f1367a4421ea8a8cbeb6c341705488ebc864 (diff)
slight loading refactor
-rw-r--r--src/client/views/Main.tsx12
-rw-r--r--src/server/authentication/controllers/WorkspacesMenu.tsx1
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);
}