From c8a226eecf85066bf6e3c08607ad94c6e10f83b7 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 27 Mar 2023 15:13:07 +0700 Subject: [PATCH] updated import private key process --- src/pages/init.tsx | 12 ++++--- src/pages/onboarding/create/index.tsx | 17 +++++----- src/pages/onboarding/create/step-2.tsx | 2 +- src/pages/onboarding/index.tsx | 2 +- src/pages/onboarding/login/step-2.tsx | 46 +++++++++++++++++++++----- 5 files changed, 55 insertions(+), 24 deletions(-) diff --git a/src/pages/init.tsx b/src/pages/init.tsx index a3ee40ab..dd003641 100644 --- a/src/pages/init.tsx +++ b/src/pages/init.tsx @@ -24,13 +24,12 @@ export default function Page() { const now = useRef(new Date()); const timer = useRef(null); - const unsubscribe = useRef(null); useEffect(() => { countTotalNotes().then((count) => { if (count.total === 0) { getAllFollowsByID(activeAccount.id).then((follows) => { - unsubscribe.current = pool.subscribe( + pool.subscribe( [ { kinds: [1], @@ -47,6 +46,9 @@ export default function Page() { undefined, () => { timer.current = setTimeout(() => router.push('/newsfeed/following'), 3000); + }, + { + unsubscribeOnEose: true, } ); }); @@ -55,7 +57,7 @@ export default function Page() { const parseDate = new Date(time); getAllFollowsByID(activeAccount.id).then((follows) => { - unsubscribe.current = pool.subscribe( + pool.subscribe( [ { kinds: [1], @@ -72,6 +74,9 @@ export default function Page() { undefined, () => { timer.current = setTimeout(() => router.push('/newsfeed/following'), 3000); + }, + { + unsubscribeOnEose: true, } ); }); @@ -80,7 +85,6 @@ export default function Page() { }); return () => { - unsubscribe.current(); clearTimeout(timer.current); }; }, [activeAccount.id, pool, relays, router]); diff --git a/src/pages/onboarding/create/index.tsx b/src/pages/onboarding/create/index.tsx index 105f049b..8fd448e7 100644 --- a/src/pages/onboarding/create/index.tsx +++ b/src/pages/onboarding/create/index.tsx @@ -39,8 +39,7 @@ export default function Page() { display_name: name, name: name, username: name.toLowerCase(), - picture: 'https://bafybeidfsbrzqbvontmucteomoz2rkrxugu462l5hyhh6uioslkfzzs4oq.ipfs.w3s.link/avatar-11.png', - banner: 'https://bafybeiacwit7hjmdefqggxqtgh6ht5dhth7ndptwn2msl5kpkodudsr7py.ipfs.w3s.link/banner-1.jpg', + picture: 'https://void.cat/d/KmypFh2fBdYCEvyJrPiN89', }), [name] ); @@ -122,7 +121,7 @@ export default function Page() { readOnly type={type} value={nsec} - className="relative w-full rounded-lg border border-black/5 px-3.5 py-2.5 shadow-input shadow-black/5 !outline-none placeholder:text-zinc-400 dark:bg-zinc-800 dark:text-zinc-200 dark:shadow-black/10 dark:placeholder:text-zinc-600" + className="relative w-full rounded-lg border border-black/5 py-2.5 pl-3.5 pr-11 shadow-input shadow-black/5 !outline-none placeholder:text-zinc-400 dark:bg-zinc-800 dark:text-zinc-200 dark:shadow-black/10 dark:placeholder:text-zinc-600" /> +
+ {done === false ? ( + + + + + ) : ( + + )} +