diff options
| author | Yash <[email protected]> | 2024-04-11 04:52:44 +0000 |
|---|---|---|
| committer | Yash <[email protected]> | 2024-04-11 04:52:44 +0000 |
| commit | 6dcc7d18c9be5e3a5e0a3ff60668424ee0158b4e (patch) | |
| tree | 179aa936536510cc707368fc7c330c4c7fbdc3f8 /apps/extension/src/content.tsx | |
| parent | novel editor (diff) | |
| parent | save user ID with url to ensure that same website can be saved by users (diff) | |
| download | supermemory-new-ui.tar.xz supermemory-new-ui.zip | |
Merge branch 'main' of https://github.com/Dhravya/supermemory into new-uinew-ui
Diffstat (limited to 'apps/extension/src/content.tsx')
| -rw-r--r-- | apps/extension/src/content.tsx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/extension/src/content.tsx b/apps/extension/src/content.tsx index 1e92bf04..d9994dca 100644 --- a/apps/extension/src/content.tsx +++ b/apps/extension/src/content.tsx @@ -1,4 +1,4 @@ -window.addEventListener('message', (event) => { +window.addEventListener("message", (event) => { if (event.source !== window) { return; } @@ -7,13 +7,13 @@ window.addEventListener('message', (event) => { if (jwt) { if ( !( - window.location.hostname === 'localhost' || - window.location.hostname === 'anycontext.dhr.wtf' || - window.location.hostname === 'supermemory.dhr.wtf' + window.location.hostname === "localhost" || + window.location.hostname === "anycontext.dhr.wtf" || + window.location.hostname === "supermemory.dhr.wtf" ) ) { console.log( - 'JWT is only allowed to be used on localhost or anycontext.dhr.wtf', + "JWT is only allowed to be used on localhost or anycontext.dhr.wtf", ); return; } @@ -22,24 +22,24 @@ window.addEventListener('message', (event) => { } }); -const appContainer = document.createElement('div'); -appContainer.id = 'anycontext-app-container'; +const appContainer = document.createElement("div"); +appContainer.id = "anycontext-app-container"; // First in the body, above the content document.body.insertBefore(appContainer, document.body.firstChild); -appContainer.style.zIndex = '9999'; +appContainer.style.zIndex = "9999"; -import ReactDOM from 'react-dom/client'; -import SideBar from './SideBar'; +import ReactDOM from "react-dom/client"; +import SideBar from "./SideBar"; // get JWT from local storage -const jwt = chrome.storage.local.get('jwt').then((data) => { +const jwt = chrome.storage.local.get("jwt").then((data) => { return data.jwt; }) as Promise<string>; -jwt.then((jwt) => { +jwt.then(() => { ReactDOM.createRoot( - document.getElementById('anycontext-app-container')!, - ).render(<SideBar jwt={jwt} />); + document.getElementById("anycontext-app-container")!, + ).render(<SideBar />); }); |