remove localstorage
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { AccountContext } from '@components/accountProvider';
|
||||
import { FormChannel } from '@components/form/channel';
|
||||
import NewsfeedLayout from '@components/layouts/newsfeed';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
@@ -8,7 +9,6 @@ import { MESSAGE_RELAYS } from '@stores/constants';
|
||||
import { dateToUnix, hoursAgo } from '@utils/getDate';
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
|
||||
import useLocalStorage from '@rehooks/local-storage';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
import { Suspense, lazy, useContext, useRef } from 'react';
|
||||
@@ -23,7 +23,7 @@ export function Page() {
|
||||
const id = searchParams.id;
|
||||
|
||||
const pool: any = useContext(RelayContext);
|
||||
const [activeAccount]: any = useLocalStorage('account', {});
|
||||
const activeAccount: any = useContext(AccountContext);
|
||||
|
||||
const setChannelMessages = useSetAtom(channelMessagesAtom);
|
||||
const resetChannelMessages = useResetAtom(channelMessagesAtom);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { AccountContext } from '@components/accountProvider';
|
||||
import FormChat from '@components/form/chat';
|
||||
import NewsfeedLayout from '@components/layouts/newsfeed';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
@@ -7,7 +8,6 @@ import { MESSAGE_RELAYS } from '@stores/constants';
|
||||
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
|
||||
import useLocalStorage from '@rehooks/local-storage';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
import { Suspense, lazy, useContext } from 'react';
|
||||
@@ -22,7 +22,7 @@ export function Page() {
|
||||
const pubkey = searchParams.pubkey;
|
||||
|
||||
const pool: any = useContext(RelayContext);
|
||||
const [activeAccount]: any = useLocalStorage('account', {});
|
||||
const activeAccount: any = useContext(AccountContext);
|
||||
|
||||
const setChatMessages = useSetAtom(chatMessagesAtom);
|
||||
const resetChatMessages = useResetAtom(chatMessagesAtom);
|
||||
|
||||
@@ -10,14 +10,12 @@ import {
|
||||
createNote,
|
||||
getActiveAccount,
|
||||
getLastLogin,
|
||||
getPlebs,
|
||||
updateLastLogin,
|
||||
} from '@utils/storage';
|
||||
import { getParentID } from '@utils/transform';
|
||||
|
||||
import LumeSymbol from '@assets/icons/Lume';
|
||||
|
||||
import { writeStorage } from '@rehooks/local-storage';
|
||||
import { useCallback, useContext, useEffect, useRef } from 'react';
|
||||
import { navigate } from 'vite-plugin-ssr/client/router';
|
||||
|
||||
@@ -149,23 +147,12 @@ export function Page() {
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
const account = res;
|
||||
// update local storage
|
||||
writeStorage('account', account);
|
||||
// fetch data
|
||||
fetchData(account, account.follows);
|
||||
} else {
|
||||
navigate('/onboarding', { overwriteLastHistoryEntry: true });
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
|
||||
getPlebs()
|
||||
.then((res) => {
|
||||
if (res && !ignore) {
|
||||
writeStorage('plebs', res);
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user