Merge branch 'main' into next

This commit is contained in:
reya 2023-11-28 09:07:14 +07:00
commit d28d183620
7 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,7 @@
"name": "lume", "name": "lume",
"description": "the communication app", "description": "the communication app",
"private": true, "private": true,
"version": "2.1.6", "version": "2.1.7",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",

2
src-tauri/Cargo.lock generated
View File

@ -2680,7 +2680,7 @@ dependencies = [
[[package]] [[package]]
name = "lume" name = "lume"
version = "2.1.6" version = "2.1.7"
dependencies = [ dependencies = [
"keyring", "keyring",
"serde", "serde",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "lume" name = "lume"
version = "2.1.6" version = "2.1.7"
description = "the communication app" description = "the communication app"
authors = ["Ren Amamiya"] authors = ["Ren Amamiya"]
license = "GPL-3.0" license = "GPL-3.0"

View File

@ -9,7 +9,7 @@
}, },
"package": { "package": {
"productName": "Lume", "productName": "Lume",
"version": "2.1.6" "version": "2.1.7"
}, },
"plugins": { "plugins": {
"fs": { "fs": {

View File

@ -69,12 +69,14 @@ export const NDKInstance = () => {
if (nsecbunker) { if (nsecbunker) {
const localSignerPrivkey = await db.secureLoad(db.account.pubkey + '-nsecbunker'); const localSignerPrivkey = await db.secureLoad(db.account.pubkey + '-nsecbunker');
const localSigner = new NDKPrivateKeySigner(localSignerPrivkey); const localSigner = new NDKPrivateKeySigner(localSignerPrivkey);
if (!localSigner) return null;
// await remoteSigner.blockUntilReady(); // await remoteSigner.blockUntilReady();
return new NDKNip46Signer(ndk, db.account.id, localSigner); return new NDKNip46Signer(ndk, db.account.id, localSigner);
} }
// Private key Signer // Private key Signer
const userPrivkey = await db.secureLoad(db.account.pubkey); const userPrivkey = await db.secureLoad(db.account.pubkey);
if (!userPrivkey) return null;
return new NDKPrivateKeySigner(userPrivkey); return new NDKPrivateKeySigner(userPrivkey);
} }

View File

@ -1,4 +1,5 @@
import * as AlertDialog from '@radix-ui/react-alert-dialog'; import * as AlertDialog from '@radix-ui/react-alert-dialog';
import { useQueryClient } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { toast } from 'sonner'; import { toast } from 'sonner';
@ -10,6 +11,7 @@ export function Logout() {
const { ndk } = useNDK(); const { ndk } = useNDK();
const navigate = useNavigate(); const navigate = useNavigate();
const queryClient = useQueryClient();
const logout = async () => { const logout = async () => {
try { try {
@ -22,6 +24,9 @@ export function Logout() {
// logout // logout
await db.accountLogout(); await db.accountLogout();
// clear cache
queryClient.clear();
// redirect to welcome screen // redirect to welcome screen
navigate('/auth/welcome'); navigate('/auth/welcome');
} catch (e) { } catch (e) {

View File

@ -30,7 +30,7 @@ export function LiveUpdater({ status }: { status: QueryStatus }) {
useEffect(() => { useEffect(() => {
let sub: NDKSubscription = undefined; 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'] }); queryClient.fetchQuery({ queryKey: ['notification'] });
const filter: NDKFilter = { const filter: NDKFilter = {