small fixes and bump version

This commit is contained in:
Ren Amamiya
2023-09-29 12:40:02 +07:00
parent 700f3eb85f
commit 09b3eeda99
12 changed files with 22 additions and 52 deletions

View File

@@ -66,7 +66,7 @@ export function CreateStep2Screen() {
if (!db.secureDB) db.secureDB = stronghold;
// save privkey to secure storage
await db.secureSave(pubkey, privkey, pubkey);
await db.secureSave(pubkey, privkey);
// redirect to next step
navigate('/auth/create/step-3', { replace: true });

View File

@@ -66,7 +66,7 @@ export function ImportStep2Screen() {
if (!db.secureDB) db.secureDB = stronghold;
// save privkey to secure storage
await db.secureSave(pubkey, privkey, pubkey);
await db.secureSave(pubkey, privkey);
// redirect to next step
navigate('/auth/import/step-3', { replace: true });

View File

@@ -1,6 +1,6 @@
import { message } from '@tauri-apps/api/dialog';
import { invoke } from '@tauri-apps/api/tauri';
import { useEffect, useState } from 'react';
import { useEffect } from 'react';
import { useNDK } from '@libs/ndk/provider';
import { useStorage } from '@libs/storage/provider';
@@ -14,12 +14,6 @@ export function SplashScreen() {
const { ndk } = useNDK();
const { fetchUserData } = useNostr();
const [isLoading, setIsLoading] = useState<boolean>(true);
const skip = async () => {
await invoke('close_splashscreen');
};
useEffect(() => {
async function syncUserData() {
if (!db.account) {
@@ -40,11 +34,11 @@ export function SplashScreen() {
await invoke('close_splashscreen');
}
} catch (e) {
setIsLoading(false);
await message(e, {
title: 'An unexpected error has occurred',
type: 'error',
});
await invoke('close_splashscreen');
}
}
}
@@ -59,34 +53,11 @@ export function SplashScreen() {
<div className="relative flex h-screen w-screen items-center justify-center bg-black">
<div data-tauri-drag-region className="absolute left-0 top-0 z-10 h-11 w-full" />
<div className="flex min-h-0 w-full flex-1 items-center justify-center px-8">
<div className="flex flex-col items-center justify-center gap-4">
<div className="flex flex-col items-center justify-center gap-6">
<LoaderIcon className="h-6 w-6 animate-spin text-white" />
{isLoading ? (
<div className="flex flex-col gap-2 text-center">
<h3 className="text-lg font-semibold leading-none text-white">
{!ndk ? 'Connecting to relay...' : 'Syncing user data...'}
</h3>
{ndk ? (
<p className="text-sm text-white/50">
Ensure all your data is sync across all Nostr clients. It may take a few
seconds, please don&apos;t close app.
</p>
) : null}
</div>
) : (
<div className="mt-2 flex flex-col gap-1 text-center">
<h3 className="text-lg font-semibold leading-none text-white">
An unexpected error has occurred
</h3>
<button
type="button"
onClick={skip}
className="mx-auto mt-4 inline-flex h-10 w-max items-center justify-center rounded-md bg-white/10 px-8 text-sm font-medium leading-none text-white backdrop-blur-xl hover:bg-white/20"
>
Skip this step
</button>
</div>
)}
<h3 className="text-lg font-semibold leading-none text-white">
{!ndk ? 'Connecting...' : 'Syncing...'}
</h3>
</div>
</div>
</div>