remove localstorage
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { AccountContext } from '@components/accountProvider';
|
||||
import { NoteMetadata } from '@components/note/metadata';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
import { UserExtend } from '@components/user/extend';
|
||||
@@ -8,15 +9,13 @@ import { contentParser } from '@utils/parser';
|
||||
import { createNote, getNoteByID } from '@utils/storage';
|
||||
import { getParentID } from '@utils/transform';
|
||||
|
||||
import useLocalStorage from '@rehooks/local-storage';
|
||||
import { memo, useCallback, useContext, useEffect, useState } from 'react';
|
||||
|
||||
export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
|
||||
const pool: any = useContext(RelayContext);
|
||||
const activeAccount: any = useContext(AccountContext);
|
||||
|
||||
const [activeAccount]: any = useLocalStorage('account', {});
|
||||
const [event, setEvent] = useState(null);
|
||||
|
||||
const content = event ? contentParser(event.content, event.tags) : '';
|
||||
|
||||
const fetchEvent = useCallback(async () => {
|
||||
@@ -55,7 +54,7 @@ export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
}, [activeAccount.id, id, pool]);
|
||||
}, [id, pool]);
|
||||
|
||||
const checkNoteIsSaved = useCallback(async () => {
|
||||
getNoteByID(id)
|
||||
|
||||
Reference in New Issue
Block a user