fixed build errors

This commit is contained in:
Ren Amamiya
2023-03-24 15:23:30 +07:00
parent c1f06f8b28
commit f1965e1b43
11 changed files with 17 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ import { relaysAtom } from '@stores/relays';
import { getNoteByID } from '@utils/storage';
import { useAtomValue } from 'jotai';
import { GetStaticPaths } from 'next';
import { useRouter } from 'next/router';
import {
JSXElementConstructor,
@@ -26,7 +27,7 @@ export default function Page() {
const pool: any = useContext(RelayContext);
const router = useRouter();
const id = router.query.id;
const id = router.query.id || null;
const relays: any = useAtomValue(relaysAtom);

View File

@@ -67,7 +67,7 @@ export default function Page() {
const pool: any = useContext(RelayContext);
const router = useRouter();
const { id, privkey }: any = router.query;
const { id, privkey }: any = router.query || '';
const relays = useAtomValue(relaysAtom);
const [loading, setLoading] = useState(false);

View File

@@ -27,8 +27,8 @@ export default function Page() {
const pool: any = useContext(RelayContext);
const router = useRouter();
const privkey: any = router.query.privkey;
const pubkey = getPublicKey(privkey);
const privkey: any = router.query.privkey || null;
const pubkey = privkey ? getPublicKey(privkey) : null;
const relays = useAtomValue(relaysAtom);
const [profile, setProfile] = useState(null);
@@ -94,7 +94,7 @@ export default function Page() {
<div className="flex items-center gap-2">
<p className="font-semibold">{profile?.display_name || profile?.name}</p>
<span className="leading-tight text-zinc-500">·</span>
<p className="text-zinc-500">@{profile?.username || truncate(pubkey, 16, ' .... ')}</p>
<p className="text-zinc-500">@{profile?.username || (pubkey && truncate(pubkey, 16, ' .... '))}</p>
</div>
<div className="space-y-3">
<div className="grid grid-cols-3 gap-4">

View File

@@ -12,7 +12,7 @@ import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from
export default function Page() {
const router = useRouter();
const id: any = router.query.id;
const id: any = router.query.id || '';
return (
<div className="scrollbar-hide h-full w-full overflow-y-auto">