diff options
-rw-r--r-- | src/client/views/Main.tsx | 15 | ||||
-rw-r--r-- | src/client/views/collections/CollectionFreeFormView.tsx | 2 | ||||
-rw-r--r-- | src/server/authentication/controllers/WorkspacesMenu.tsx | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 5a0fb23bd..2f4264ad9 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -49,19 +49,14 @@ export class Main extends React.Component { initAuthenticationRouters = () => { // Load the user's active workspace, or create a new one if initial session after signup - request.get(window.location.origin + "/getActiveWorkspaceId", (error, response, body) => { + request.get(this.contextualize("getActiveWorkspaceId"), (error, response, body) => { this.requestWorkspace(body ? body : this.getNewWorkspace()); }); } getNewWorkspace = (): string => { let newId = Utils.GenerateGuid(); - const here = window.location.origin; - request.post(here + "/addWorkspaceId", { - body: { target: newId }, - json: true - }) - request.post(here + "/setActiveWorkspaceId", { + request.post(this.contextualize("addWorkspaceId"), { body: { target: newId }, json: true }) @@ -70,6 +65,10 @@ export class Main extends React.Component { @action requestWorkspace = (activeWorkspaceId: string) => { + request.post(this.contextualize("setActiveWorkspaceId"), { + body: { target: activeWorkspaceId }, + json: true + }) Documents.initProtos(activeWorkspaceId, this.prepareWorkspace); } @@ -99,6 +98,8 @@ export class Main extends React.Component { } } + contextualize = (extension: string) => window.location.origin + "/" + extension; + render() { let imgRef = React.createRef<HTMLDivElement>(); let webRef = React.createRef<HTMLDivElement>(); diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index 5e9dcd5d5..43f5fe6d6 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -277,7 +277,7 @@ export class CollectionFreeFormView extends CollectionViewBase { const pany: number = -this.props.Document.GetNumber(KeyStore.PanY, 0); // const panx: number = this.props.Document.GetNumber(KeyStore.PanX, 0) + this.centeringShiftX; // const pany: number = this.props.Document.GetNumber(KeyStore.PanY, 0) + this.centeringShiftY; - console.log("center:", this.getLocalTransform().transformPoint(this.centeringShiftX, this.centeringShiftY)); + // console.log("center:", this.getLocalTransform().transformPoint(this.centeringShiftX, this.centeringShiftY)); return ( <div className="collectionfreeformview-container" diff --git a/src/server/authentication/controllers/WorkspacesMenu.tsx b/src/server/authentication/controllers/WorkspacesMenu.tsx index fe93aac2c..b565af193 100644 --- a/src/server/authentication/controllers/WorkspacesMenu.tsx +++ b/src/server/authentication/controllers/WorkspacesMenu.tsx @@ -21,7 +21,6 @@ export class WorkspacesMenu extends React.Component<WorkspaceMenuProps> { constructor(props: WorkspaceMenuProps) { super(props); WorkspacesMenu.Instance = this; - console.log("ASSIGNED!"); this.loadExistingWorkspace = this.loadExistingWorkspace.bind(this); this.addNewWorkspace = this.addNewWorkspace.bind(this); this.selectedWorkspaceId = this.props.active; @@ -33,9 +32,6 @@ export class WorkspacesMenu extends React.Component<WorkspaceMenuProps> { this.selectedWorkspaceId = newId; this.props.load(newId); this.toggle(); - // setTimeout(action(() => { - - // }), 100); } @action |