use top level await for some functions

This commit is contained in:
Ren Amamiya
2023-04-23 12:15:04 +07:00
parent ac6fb3cb55
commit 97c45a8c8f
11 changed files with 270 additions and 271 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ export function Page() {
() => {
updateLastLogin(dateToUnix(now.current));
timeout.current = setTimeout(() => {
navigate('/newsfeed/following');
navigate('/newsfeed/following', { overwriteLastHistoryEntry: true });
}, 5000);
},
{
@@ -60,7 +60,7 @@ export function Page() {
// broadcast
pool.publish(event, relays);
// redirect to next step
navigate(`/onboarding/create/step-2?pubkey=${pubkey}&privkey=${privkey}`);
navigate(`/onboarding/create/step-2?pubkey=${pubkey}&privkey=${privkey}`, { overwriteLastHistoryEntry: true });
}, [pool, pubkey, privkey, metadata, relays]);
return (
@@ -39,7 +39,7 @@ export function Page() {
privkey = nip19.decode(privkey).data;
}
if (typeof getPublicKey(privkey) === 'string') {
navigate(`/onboarding/login/step-2?privkey=${privkey}`);
navigate(`/onboarding/login/step-2?privkey=${privkey}`, { overwriteLastHistoryEntry: true });
}
} catch (error) {
setError('key', {