clean up
This commit is contained in:
@@ -3,7 +3,6 @@ import { RelayContext } from '@components/relaysProvider';
|
||||
import { UserExtend } from '@components/user/extend';
|
||||
|
||||
import { activeAccountAtom } from '@stores/account';
|
||||
import { relaysAtom } from '@stores/relays';
|
||||
|
||||
import { dateToUnix } from '@utils/getDate';
|
||||
|
||||
@@ -33,11 +32,10 @@ export const NoteComment = memo(function NoteComment({
|
||||
const router = useRouter();
|
||||
const [pool, relays]: any = useContext(RelayContext);
|
||||
|
||||
const activeAccount: any = useAtomValue(activeAccountAtom);
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
const activeAccount: any = useAtomValue(activeAccountAtom);
|
||||
const profile = destr(activeAccount.metadata);
|
||||
|
||||
const openThread = () => {
|
||||
@@ -49,7 +47,7 @@ export const NoteComment = memo(function NoteComment({
|
||||
content: value,
|
||||
created_at: dateToUnix(),
|
||||
kind: 1,
|
||||
pubkey: activeAccount.id,
|
||||
pubkey: activeAccount.pubkey,
|
||||
tags: [['e', eventID]],
|
||||
};
|
||||
event.id = getEventHash(event);
|
||||
|
||||
@@ -38,7 +38,7 @@ export const NoteReaction = memo(function NoteReaction({
|
||||
['p', eventPubkey],
|
||||
],
|
||||
created_at: dateToUnix(),
|
||||
pubkey: activeAccount.id,
|
||||
pubkey: activeAccount.pubkey,
|
||||
};
|
||||
event.id = getEventHash(event);
|
||||
event.sig = signEvent(event, activeAccount.privkey);
|
||||
|
||||
@@ -2,8 +2,6 @@ import { NoteComment } from '@components/note/meta/comment';
|
||||
import { NoteReaction } from '@components/note/meta/reaction';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
|
||||
import { createCacheCommentNote } from '@utils/storage';
|
||||
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
export default function NoteMetadata({
|
||||
@@ -39,7 +37,7 @@ export default function NoteMetadata({
|
||||
// update state
|
||||
setComments((comments) => (comments += 1));
|
||||
// save comment to database
|
||||
createCacheCommentNote(event, eventID);
|
||||
// createCacheCommentNote(event, eventID);
|
||||
break;
|
||||
case 7:
|
||||
if (event.content === '🤙' || event.content === '+') {
|
||||
|
||||
@@ -45,7 +45,7 @@ export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
|
||||
parent_id: parentID,
|
||||
parent_comment_id: '',
|
||||
created_at: event.created_at,
|
||||
account_id: activeAccount.id,
|
||||
account_id: activeAccount.pubkey,
|
||||
}).catch(console.error);
|
||||
},
|
||||
undefined,
|
||||
|
||||
@@ -41,7 +41,7 @@ export const NoteRepost = memo(function NoteRepost({ id }: { id: string }) {
|
||||
parent_id: parentID,
|
||||
parent_comment_id: '',
|
||||
created_at: event.created_at,
|
||||
account_id: activeAccount.id,
|
||||
account_id: activeAccount.pubkey,
|
||||
}).catch(console.error);
|
||||
},
|
||||
undefined,
|
||||
|
||||
Reference in New Issue
Block a user