fix crash on settings screen

This commit is contained in:
reya 2023-11-26 15:01:13 +07:00
parent 34dceef4a3
commit 8439428ce1
7 changed files with 15 additions and 22 deletions

View File

@ -2,7 +2,7 @@
"name": "lume",
"description": "the communication app",
"private": true,
"version": "2.1.4",
"version": "2.1.5",
"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.4"
version = "2.1.5"
dependencies = [
"keyring",
"serde",

View File

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

View File

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

View File

@ -57,7 +57,7 @@ export function ProfileCard() {
{user?.display_name || user?.name}
</h3>
<p className="text-lg text-neutral-700 dark:text-neutral-300">
{user.nip05 || displayNpub(db.account.pubkey, 16)}
{user?.nip05 || displayNpub(db.account.pubkey, 16)}
</p>
</div>
</div>

View File

@ -184,10 +184,7 @@ export function EditProfileScreen() {
</label>
<input
type={'text'}
{...register('display_name', {
required: true,
minLength: 4,
})}
{...register('display_name')}
spellCheck={false}
className="relative h-11 w-full rounded-lg bg-neutral-100 px-3 py-1 text-neutral-900 !outline-none backdrop-blur-xl placeholder:text-neutral-500 dark:bg-neutral-900 dark:text-neutral-100"
/>
@ -201,10 +198,7 @@ export function EditProfileScreen() {
</label>
<input
type={'text'}
{...register('name', {
required: true,
minLength: 4,
})}
{...register('name')}
spellCheck={false}
className="relative h-11 w-full rounded-lg bg-neutral-100 px-3 py-1 text-neutral-900 !outline-none backdrop-blur-xl placeholder:text-neutral-500 dark:bg-neutral-900 dark:text-neutral-100"
/>
@ -218,10 +212,7 @@ export function EditProfileScreen() {
</label>
<div className="relative">
<input
{...register('nip05', {
required: true,
minLength: 4,
})}
{...register('nip05')}
spellCheck={false}
className="relative h-11 w-full rounded-lg bg-neutral-100 px-3 py-1 text-neutral-900 !outline-none backdrop-blur-xl placeholder:text-neutral-500 dark:bg-neutral-900 dark:text-neutral-100"
/>

View File

@ -1,4 +1,4 @@
import { Link, NavLink, Outlet, ScrollRestoration } from 'react-router-dom';
import { NavLink, Outlet, ScrollRestoration, useNavigate } from 'react-router-dom';
import { twMerge } from 'tailwind-merge';
import { WindowTitlebar } from 'tauri-controls';
@ -15,6 +15,7 @@ import {
export function SettingsLayout() {
const { db } = useStorage();
const navigate = useNavigate();
return (
<div className="flex h-screen w-screen flex-col bg-neutral-50 dark:bg-neutral-950">
@ -26,16 +27,17 @@ export function SettingsLayout() {
<div className="flex h-full min-h-0 w-full flex-col gap-8 overflow-y-auto pb-10">
<div className="flex h-20 w-full items-center justify-between border-b border-neutral-200 px-2 pb-2 dark:border-neutral-900">
<div>
<Link
to="/"
<button
type="button"
onClick={() => navigate(-1)}
className="inline-flex h-12 w-12 items-center justify-center rounded-xl bg-neutral-100 dark:bg-neutral-900"
>
<ArrowLeftIcon className="h-5 w-5" />
</Link>
</button>
</div>
<div className="flex items-center gap-0.5">
<NavLink
to="/settings"
to="/settings/"
end
className={({ isActive }) =>
twMerge(