diff --git a/package.json b/package.json index 77a7ceb1..d4d467fb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lume", "description": "the communication app", "private": true, - "version": "2.1.6", + "version": "2.1.7", "scripts": { "dev": "vite", "build": "vite build", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 004a8b8d..505d9d1d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2680,7 +2680,7 @@ dependencies = [ [[package]] name = "lume" -version = "2.1.6" +version = "2.1.7" dependencies = [ "keyring", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index fa8ab071..71ed327e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lume" -version = "2.1.6" +version = "2.1.7" description = "the communication app" authors = ["Ren Amamiya"] license = "GPL-3.0" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2a3cafff..b8a43fc3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "Lume", - "version": "2.1.6" + "version": "2.1.7" }, "plugins": { "fs": { diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts index e00953b0..26df8a2f 100644 --- a/src/libs/ndk/instance.ts +++ b/src/libs/ndk/instance.ts @@ -69,12 +69,14 @@ export const NDKInstance = () => { if (nsecbunker) { const localSignerPrivkey = await db.secureLoad(db.account.pubkey + '-nsecbunker'); const localSigner = new NDKPrivateKeySigner(localSignerPrivkey); + if (!localSigner) return null; // await remoteSigner.blockUntilReady(); return new NDKNip46Signer(ndk, db.account.id, localSigner); } // Private key Signer const userPrivkey = await db.secureLoad(db.account.pubkey); + if (!userPrivkey) return null; return new NDKPrivateKeySigner(userPrivkey); } diff --git a/src/shared/logout.tsx b/src/shared/logout.tsx index 8818463c..7f3812eb 100644 --- a/src/shared/logout.tsx +++ b/src/shared/logout.tsx @@ -1,4 +1,5 @@ import * as AlertDialog from '@radix-ui/react-alert-dialog'; +import { useQueryClient } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; import { toast } from 'sonner'; @@ -10,6 +11,7 @@ export function Logout() { const { ndk } = useNDK(); const navigate = useNavigate(); + const queryClient = useQueryClient(); const logout = async () => { try { @@ -22,6 +24,9 @@ export function Logout() { // logout await db.accountLogout(); + // clear cache + queryClient.clear(); + // redirect to welcome screen navigate('/auth/welcome'); } catch (e) { diff --git a/src/shared/widgets/other/liveUpdater.tsx b/src/shared/widgets/other/liveUpdater.tsx index 1e33dea9..bcd41ddb 100644 --- a/src/shared/widgets/other/liveUpdater.tsx +++ b/src/shared/widgets/other/liveUpdater.tsx @@ -30,7 +30,7 @@ export function LiveUpdater({ status }: { status: QueryStatus }) { useEffect(() => { let sub: NDKSubscription = undefined; - if (status === 'success' && db.account && db.account.follows.length > 0) { + if (status === 'success' && db.account && db.account?.follows?.length > 0) { queryClient.fetchQuery({ queryKey: ['notification'] }); const filter: NDKFilter = {