mirror of
https://github.com/hoornet/vega.git
synced 2026-05-07 04:39:12 -07:00
Bump version to v0.1.8 — Windows playtest fixes
- Fix switchAccount: check signer was set after loginWithNsec before returning; fall back to loginWithPubkey on silent failure; always navigate to feed after switch to clear stale UI - Fix profile edit button: hidden in read-only (npub) mode; read-only badge shown in profile header to make state visible - Sidebar: show version number (v0.1.8) below WRYSTR brand, auto-tracked from package.json — no more hardcoding - Support page: increase QR code gap (gap-8 → gap-16) to prevent accidentally scanning the wrong address - ROADMAP: add language/alphabet feed filter to Phase 3 backlog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { nip19 } from "@nostr-dev-kit/ndk";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { useMuteStore } from "./mute";
|
||||
import { useLightningStore } from "./lightning";
|
||||
import { useUIStore } from "./ui";
|
||||
|
||||
export interface SavedAccount {
|
||||
pubkey: string;
|
||||
@@ -184,17 +185,23 @@ export const useUserStore = create<UserState>((set, get) => ({
|
||||
switchAccount: async (pubkey: string) => {
|
||||
// Clear signer immediately — no window where old account could sign
|
||||
getNDK().signer = undefined;
|
||||
let succeeded = false;
|
||||
// Try nsec from keychain first; fall back to read-only
|
||||
try {
|
||||
const nsec = await invoke<string | null>("load_nsec", { pubkey });
|
||||
if (nsec) {
|
||||
await get().loginWithNsec(nsec);
|
||||
return;
|
||||
// Only consider it a success if signer was actually set
|
||||
succeeded = !!getNDK().signer;
|
||||
}
|
||||
} catch {
|
||||
// Keychain unavailable
|
||||
}
|
||||
await get().loginWithPubkey(pubkey);
|
||||
if (!succeeded) {
|
||||
await get().loginWithPubkey(pubkey);
|
||||
}
|
||||
// Always land on feed to avoid stale UI from previous account's view
|
||||
useUIStore.getState().setView("feed");
|
||||
},
|
||||
|
||||
removeAccount: (pubkey: string) => {
|
||||
|
||||
Reference in New Issue
Block a user