rework macos version

This commit is contained in:
Phong
2023-10-11 13:45:56 +07:00
parent c3f399ea0b
commit 2fcbf1987b
18 changed files with 394 additions and 445 deletions

View File

@@ -61,7 +61,7 @@ export function ImportStep2Screen() {
setLoading(true);
if (data.password.length > 3) {
const dir = await appConfigDir();
const stronghold = await Stronghold.load(`${dir}lume.stronghold`, data.password);
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
if (!db.secureDB) db.secureDB = stronghold;

View File

@@ -2,7 +2,7 @@ import { appConfigDir } from '@tauri-apps/api/path';
import { Stronghold } from '@tauri-apps/plugin-stronghold';
import { useState } from 'react';
import { Resolver, useForm } from 'react-hook-form';
import { Link, useNavigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import { useStorage } from '@libs/storage/provider';
@@ -33,7 +33,6 @@ export function UnlockScreen() {
const navigate = useNavigate();
const setPrivkey = useStronghold((state) => state.setPrivkey);
const setWalletConnectURL = useStronghold((state) => state.setWalletConnectURL);
const resetStronghold = useStronghold((state) => state.reset);
const [showPassword, setShowPassword] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
@@ -43,7 +42,7 @@ export function UnlockScreen() {
register,
setError,
handleSubmit,
formState: { errors, isDirty, isValid },
formState: { isDirty, isValid },
} = useForm<FormValues>({ resolver });
const onSubmit = async (data: { [x: string]: string }) => {
@@ -71,15 +70,6 @@ export function UnlockScreen() {
}
};
const logout = async () => {
// remove account
db.accountLogout();
// reset stronghold
resetStronghold();
// redirect to welcome screen
navigate('/auth/welcome');
};
return (
<div className="flex h-full w-full items-center justify-center">
<div className="mx-auto w-full max-w-md">

View File

@@ -110,7 +110,7 @@ export function RelayScreen() {
href={`https://nips.be/${item}`}
target="_blank"
rel="noreferrer"
className="inline-flex aspect-square h-full w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium hover:bg-blue-600"
className="inline-flex aspect-square h-auto w-full items-center justify-center rounded-lg bg-white/10 text-sm font-medium hover:bg-blue-600"
>
{item}
</a>