diff --git a/src/components/accountProvider.tsx b/src/components/accountProvider.tsx index 2320a1bd..6ee37d1e 100644 --- a/src/components/accountProvider.tsx +++ b/src/components/accountProvider.tsx @@ -2,7 +2,7 @@ import { createContext } from 'react'; export const AccountContext = createContext({}); -let activeAccount: any = null; +let activeAccount: any = { id: '', pubkey: '', follows: null, metadata: '' }; if (typeof window !== 'undefined') { const { getActiveAccount } = await import('@utils/storage'); diff --git a/src/components/eventCollector.tsx b/src/components/eventCollector.tsx index aca585c7..ebb831a5 100644 --- a/src/components/eventCollector.tsx +++ b/src/components/eventCollector.tsx @@ -17,7 +17,7 @@ export default function EventCollector() { const activeAccount: any = useContext(AccountContext); const setHasNewerNote = useSetAtom(hasNewerNoteAtom); - const follows = activeAccount ? JSON.parse(activeAccount.follows) : []; + const follows = activeAccount.follows ? JSON.parse(activeAccount.follows) : []; const now = useRef(new Date()); diff --git a/src/pages/channel/index.page.client.tsx b/src/pages/channel/index.page.tsx similarity index 100% rename from src/pages/channel/index.page.client.tsx rename to src/pages/channel/index.page.tsx diff --git a/src/pages/chat/index.page.client.tsx b/src/pages/chat/index.page.tsx similarity index 100% rename from src/pages/chat/index.page.client.tsx rename to src/pages/chat/index.page.tsx diff --git a/src/pages/newsfeed/following/index.page.client.tsx b/src/pages/newsfeed/following/index.page.tsx similarity index 100% rename from src/pages/newsfeed/following/index.page.client.tsx rename to src/pages/newsfeed/following/index.page.tsx diff --git a/src/pages/onboarding/create/index.page.client.tsx b/src/pages/onboarding/create/index.page.tsx similarity index 100% rename from src/pages/onboarding/create/index.page.client.tsx rename to src/pages/onboarding/create/index.page.tsx diff --git a/src/pages/onboarding/create/step-2/index.page.client.tsx b/src/pages/onboarding/create/step-2/index.page.tsx similarity index 98% rename from src/pages/onboarding/create/step-2/index.page.client.tsx rename to src/pages/onboarding/create/step-2/index.page.tsx index a1e7ef06..bde7f60e 100644 --- a/src/pages/onboarding/create/step-2/index.page.client.tsx +++ b/src/pages/onboarding/create/step-2/index.page.tsx @@ -59,8 +59,8 @@ export function Page() { const pageContext = usePageContext(); const searchParams: any = pageContext.urlParsed.search; - const pubkey = searchParams.pubkey; - const privkey = searchParams.privkey; + const pubkey = searchParams.pubkey || ''; + const privkey = searchParams.privkey || ''; const pool: any = useContext(RelayContext); const [loading, setLoading] = useState(false); diff --git a/src/pages/onboarding/login/index.page.client.tsx b/src/pages/onboarding/login/index.page.tsx similarity index 100% rename from src/pages/onboarding/login/index.page.client.tsx rename to src/pages/onboarding/login/index.page.tsx diff --git a/src/pages/onboarding/login/step-2/index.page.client.tsx b/src/pages/onboarding/login/step-2/index.page.tsx similarity index 98% rename from src/pages/onboarding/login/step-2/index.page.client.tsx rename to src/pages/onboarding/login/step-2/index.page.tsx index 45af9841..b1b6d7a2 100644 --- a/src/pages/onboarding/login/step-2/index.page.client.tsx +++ b/src/pages/onboarding/login/step-2/index.page.tsx @@ -18,7 +18,7 @@ export function Page() { const searchParams = pageContext.urlParsed.search; const privkey = searchParams.privkey; - const pubkey = useMemo(() => getPublicKey(privkey), [privkey]); + const pubkey = useMemo(() => (privkey ? getPublicKey(privkey) : ''), [privkey]); const pool: any = useContext(RelayContext); const [profile, setProfile] = useState({ metadata: null }); diff --git a/src/pages/user/index.page.client.tsx b/src/pages/user/index.page.tsx similarity index 99% rename from src/pages/user/index.page.client.tsx rename to src/pages/user/index.page.tsx index c35af46f..cd43e928 100644 --- a/src/pages/user/index.page.client.tsx +++ b/src/pages/user/index.page.tsx @@ -1,5 +1,3 @@ -'use client'; - import NewsfeedLayout from '@components/layouts/newsfeed'; import ProfileFollowers from '@components/profile/followers'; import ProfileFollows from '@components/profile/follows';