Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

refactor: remove signOut call to preserve local UI state during account switch

yoginth.com 6adaf247 31f7f024

verified
+3 -19
+2 -2
apps/web/src/components/Shared/Account/SwitchAccounts.tsx
··· 13 13 import errorToast from "@/helpers/errorToast"; 14 14 import reloadAllTabs from "@/helpers/reloadAllTabs"; 15 15 import { useAccountStore } from "@/store/persisted/useAccountStore"; 16 - import { signIn, signOut } from "@/store/persisted/useAuthStore"; 16 + import { signIn } from "@/store/persisted/useAuthStore"; 17 17 import SmallSingleAccount from "./SmallSingleAccount"; 18 18 19 19 const SwitchAccounts = () => { ··· 68 68 if (auth.data?.switchAccount.__typename === "AuthenticationTokens") { 69 69 const accessToken = auth.data?.switchAccount.accessToken; 70 70 const refreshToken = auth.data?.switchAccount.refreshToken; 71 - signOut(); 71 + // Preserve theme and other local UI state by not signing out completely. 72 72 signIn({ accessToken, refreshToken }); 73 73 reloadAllTabs(); 74 74 return;
+1 -1
apps/web/tsconfig.json
··· 5 5 "paths": { "@/*": ["./src/*"] } 6 6 }, 7 7 "extends": "@hey/config/react.tsconfig.json", 8 - "include": ["**/*.ts", "**/*.tsx", "vite.config.mjs"] 8 + "include": ["**/*.ts", "**/*.tsx", "vite.config.mjs", "vitest.config.mjs"] 9 9 }
-16
apps/web/vitest.config.ts
··· 1 - import path from "node:path"; 2 - import react from "@vitejs/plugin-react"; 3 - import { defineConfig } from "vitest/config"; 4 - 5 - export default defineConfig({ 6 - plugins: [react()], 7 - resolve: { 8 - alias: { 9 - "@": path.resolve(__dirname, "./src") 10 - } 11 - }, 12 - test: { 13 - environment: "jsdom", 14 - setupFiles: "./vitest.setup.ts" 15 - } 16 - });