From 3c6c9c86d164c853b4084f464238ec9dfee335b8 Mon Sep 17 00:00:00 2001 From: reya Date: Tue, 28 Nov 2023 09:00:46 +0700 Subject: [PATCH] 2.1.7 --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/libs/ndk/instance.ts | 2 ++ src/shared/logout.tsx | 5 +++++ src/shared/widgets/other/liveUpdater.tsx | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0472a889..c09b620a 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 c7d443b5..086149e7 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 = {