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",
"description": "the communication app",
"private": true,
"version": "2.1.6",
"version": "2.1.7",
"scripts": {
"dev": "vite",
"build": "vite build",

2
src-tauri/Cargo.lock generated
View File

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

View File

@ -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"

View File

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

View File

@ -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);
}

View File

@ -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) {

View File

@ -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 = {