mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
## What
Fixes two bugs reported by a customer (Plain T-1289) using the Supermemory browser extension.
### Bug 1 — extension sign-in loop
When a user logs out of the _extension_ but is still authenticated in the _web app_, the extension's Sign-in button opens `/login`, which short-circuited via a bare `router.replace("/")`. That path never carried the `extension-auth-success` flag the dashboard waits on before `postMessage`\-ing the session token to the extension content script — so the extension never received a token and stayed stuck on "Sign in" indefinitely.
Now the already-authenticated redirect carries `?extension-auth-success=true`, matching the existing fresh-login callback behavior (no new token exposure).
### Bug 2 — stale / deleted spaces
The extension's stored default space (`local:sm-default-project`) was only set when none existed, never reconciled. After renaming/deleting spaces in the web app, the popup kept showing save buttons pointing at dead spaces. Now the popup reconciles the stored default against the freshly-fetched live list: resets to the first space if the stored one was deleted, and refreshes the cached copy (label/containerTag) if it was renamed.
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import path from "node:path"
|
|
import { createRequire } from "node:module"
|
|
import tailwindcss from "@tailwindcss/vite"
|
|
import { defineConfig, type WxtViteConfig } from "wxt"
|
|
|
|
const require = createRequire(import.meta.url)
|
|
|
|
function reactPackageRoot(pkg: "react" | "react-dom"): string {
|
|
return path.dirname(require.resolve(`${pkg}/package.json`))
|
|
}
|
|
|
|
// See https://wxt.dev/api/config.html
|
|
export default defineConfig({
|
|
modules: ["@wxt-dev/module-react"],
|
|
vite: () =>
|
|
({
|
|
plugins: [tailwindcss()],
|
|
resolve: {
|
|
dedupe: ["react", "react-dom"],
|
|
alias: {
|
|
react: reactPackageRoot("react"),
|
|
"react-dom": reactPackageRoot("react-dom"),
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ["react", "react-dom", "@tanstack/react-query"],
|
|
},
|
|
}) as WxtViteConfig,
|
|
manifest: {
|
|
name: "supermemory",
|
|
homepage_url: "https://supermemory.ai",
|
|
version: "6.1.4",
|
|
permissions: ["storage", "activeTab", "webRequest", "tabs"],
|
|
host_permissions: [
|
|
"*://x.com/*",
|
|
"*://twitter.com/*",
|
|
"*://supermemory.ai/*",
|
|
"*://api.supermemory.ai/*",
|
|
"*://chatgpt.com/*",
|
|
"*://chat.openai.com/*",
|
|
"https://*.posthog.com/*",
|
|
],
|
|
web_accessible_resources: [
|
|
{
|
|
resources: ["icon-16.png", "fonts/*.ttf"],
|
|
matches: ["<all_urls>"],
|
|
},
|
|
],
|
|
},
|
|
webExt: {
|
|
chromiumArgs: ["--user-data-dir=./.wxt/chrome-data"],
|
|
},
|
|
})
|