Skip to content

Commit

Permalink
Extend window interface
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkov committed Jul 21, 2023
1 parent f698041 commit 43f323d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/src/indexBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { useState } from "react";
import * as ReactDOM from "react-dom";
import "@tldraw/tldraw/editor.css";
import "@tldraw/tldraw/ui.css";
import { App, Tldraw, TldrawEditorConfig, TLShapeId } from "@tldraw/tldraw";
import "./index.css";
import { Format, InteractiveHyp, InteractiveGoal, ApiResponse } from "./types";
import { buildProofTree } from './buildProofTree';
import { buildProofTree } from "./buildProofTree";
import { WindowShape } from "./shapes/WindowShape";
import { CustomArrowShape } from "./shapes/CustomArrowShape";
import { createNodeId } from './buildProofTree/services/CreateId'
import { createNodeId } from "./buildProofTree/services/CreateId";

import { useInterval } from 'usehooks-ts'
import { useInterval } from "usehooks-ts";

import {
App,
Tldraw,
TldrawEditorConfig,
TLShapeId
} from "@tldraw/tldraw";
interface PaperProofWindow extends Window {
sessionId: string | null;
}

declare const window: PaperProofWindow;

const BASE_URL = "http://localhost:80";

Expand Down Expand Up @@ -159,10 +159,10 @@ function Main() {
app.zoomToFit({ duration: 100 });
}, 200);

if (window["sessionId"]) {
if (window.sessionId) {
// This is loaded in browser.
console.log("Browser mode");
setSessionId(window["sessionId"]);
setSessionId(window.sessionId);
}

// Listen for direct messages from extension instead of round trip through server
Expand Down Expand Up @@ -201,7 +201,7 @@ function Main() {

ReactDOM.render(
<React.StrictMode>
<Main/>
<Main />
</React.StrictMode>,
document.getElementById("root")
);

0 comments on commit 43f323d

Please sign in to comment.