diff options
| author | Dhravya <[email protected]> | 2024-04-12 22:38:12 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-12 22:38:12 -0700 |
| commit | 0d6cd7c447ccd4af05031d9897786abfee80b6b8 (patch) | |
| tree | abded39a0c9acc02399a69a1dd5c251d8e03ec83 /apps/extension/src | |
| parent | Merge branch 'main' of https://github.com/Dhravya/supermemory (diff) | |
| download | supermemory-0d6cd7c447ccd4af05031d9897786abfee80b6b8.tar.xz supermemory-0d6cd7c447ccd4af05031d9897786abfee80b6b8.zip | |
added logic for importing all tweets
Diffstat (limited to 'apps/extension/src')
| -rw-r--r-- | apps/extension/src/SideBar.tsx | 6 | ||||
| -rw-r--r-- | apps/extension/src/content.tsx | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/extension/src/SideBar.tsx b/apps/extension/src/SideBar.tsx index 7743be5e..9ecb8afa 100644 --- a/apps/extension/src/SideBar.tsx +++ b/apps/extension/src/SideBar.tsx @@ -35,7 +35,7 @@ function sendUrlToAPI() { } } -function SideBar() { +function SideBar({ jwt }: { jwt: string }) { // TODO: Implement getting bookmarks from Twitter API directly // chrome.runtime.onMessage.addListener(function (request) { // if (request.action === 'showProgressIndicator') { @@ -62,6 +62,7 @@ function SideBar() { authorName: string; handle: string; time: string; + saveToUser: string; } const fetchBookmarks = () => { @@ -136,6 +137,7 @@ function SideBar() { tweetText, time: time ?? "", postUrl, + saveToUser: jwt, }); setLog([...log, `Scraped tweet: ${tweets.length}`]); @@ -162,7 +164,7 @@ function SideBar() { setIsImportingTweets(false); const jsonData = JSON.stringify(tweetsArray); // Convert the array to JSON - // TODO: SEND jsonData to server + // TODO: send jsonData to the API console.log(jsonData); } }; diff --git a/apps/extension/src/content.tsx b/apps/extension/src/content.tsx index d9994dca..83d976cd 100644 --- a/apps/extension/src/content.tsx +++ b/apps/extension/src/content.tsx @@ -38,8 +38,8 @@ const jwt = chrome.storage.local.get("jwt").then((data) => { return data.jwt; }) as Promise<string>; -jwt.then(() => { +jwt.then((token) => { ReactDOM.createRoot( document.getElementById("anycontext-app-container")!, - ).render(<SideBar />); + ).render(<SideBar jwt={token} />); }); |