diff --git a/apps/extension/manifest.json b/apps/extension/manifest.json index 53bddb24..b8b66cce 100644 --- a/apps/extension/manifest.json +++ b/apps/extension/manifest.json @@ -17,8 +17,8 @@ "src/content.tsx" ], "matches": [ - "http://localhost:3000/*", - "https://anycontext.dhr.wtf/*", + "http://localhost:3000/", + "https://anycontext.dhr.wtf/", "" ] } diff --git a/apps/extension/src/App.tsx b/apps/extension/src/App.tsx index a442cbb9..551fb0d0 100644 --- a/apps/extension/src/App.tsx +++ b/apps/extension/src/App.tsx @@ -1,6 +1,9 @@ import { useEffect, useState } from 'react'; import { z } from 'zod'; import { userObj } from './types/zods'; +import { getEnv } from './util'; + +const backendUrl = getEnv() === "development" ? "http://localhost:3000" : "https://supermemory.dhr.wtf"; function App() { const [userData, setUserData] = useState | null>( @@ -14,7 +17,7 @@ function App() { if (loginButton) { if (jwt) { - fetch('https://supermemory.dhr.wtf/api/me', { + fetch(`${backendUrl}/api/me`, { headers: { Authorization: `Bearer ${jwt}`, }, @@ -43,7 +46,7 @@ function App() {