This commit is contained in:
Ren Amamiya
2023-04-05 09:48:57 +07:00
parent fc8dc8fd0d
commit beb622f05e
13 changed files with 23 additions and 233 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 === '+') {

View File

@@ -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,

View File

@@ -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,