This commit is contained in:
reya
2023-10-12 09:13:06 +07:00
parent 3b46e71525
commit 35650a40f2
36 changed files with 444 additions and 1447 deletions
+2 -5
View File
@@ -13,13 +13,10 @@ import { useStorage } from '@libs/storage/provider';
import { LoaderIcon } from '@shared/icons';
import { User } from '@shared/user';
import { useStronghold } from '@stores/stronghold';
import { useNostr } from '@utils/hooks/useNostr';
export function ChatScreen() {
const listRef = useRef<VListHandle>(null);
const userPrivkey = useStronghold((state) => state.privkey);
const { db } = useStorage();
const { ndk } = useNDK();
@@ -35,7 +32,7 @@ export function ChatScreen() {
<ChatMessage
message={message}
userPubkey={db.account.pubkey}
userPrivkey={userPrivkey}
userPrivkey={''}
self={message.pubkey === db.account.pubkey}
/>
);
@@ -108,7 +105,7 @@ export function ChatScreen() {
<ChatForm
receiverPubkey={pubkey}
userPubkey={db.account.pubkey}
userPrivkey={userPrivkey}
userPrivkey={''}
/>
</div>
</div>
+1 -4
View File
@@ -9,8 +9,6 @@ import { useDecryptMessage } from '@app/chats/hooks/useDecryptMessage';
import { useStorage } from '@libs/storage/provider';
import { useStronghold } from '@stores/stronghold';
import { formatCreatedAt } from '@utils/createdAt';
import { useProfile } from '@utils/hooks/useProfile';
import { displayNpub } from '@utils/shortenKey';
@@ -19,8 +17,7 @@ export const ChatListItem = memo(function ChatListItem({ event }: { event: NDKEv
const { db } = useStorage();
const { status, user } = useProfile(event.pubkey);
const privkey = useStronghold((state) => state.privkey);
const decryptedContent = useDecryptMessage(event, db.account.pubkey, privkey);
const decryptedContent = useDecryptMessage(event, db.account.pubkey);
const createdAt = formatCreatedAt(event.created_at, true);
const svgURI =