update personal dashboard screen

This commit is contained in:
2023-11-03 15:38:58 +07:00
parent 64b4745993
commit da0b48c5df
22 changed files with 499 additions and 61 deletions

View File

@@ -39,9 +39,9 @@ export function NostrBandUserProfile({ data }: { data: Profile }) {
const follow = async (pubkey: string) => {
try {
const user = ndk.getUser({ hexpubkey: db.account.pubkey });
const user = ndk.getUser({ pubkey: db.account.pubkey });
const contacts = await user.follows();
const add = await user.follow(new NDKUser({ hexpubkey: pubkey }), contacts);
const add = await user.follow(new NDKUser({ pubkey: pubkey }), contacts);
if (add) {
setFollowed(true);
@@ -55,14 +55,12 @@ export function NostrBandUserProfile({ data }: { data: Profile }) {
const unfollow = async (pubkey: string) => {
try {
const user = ndk.getUser({ hexpubkey: db.account.pubkey });
const user = ndk.getUser({ pubkey: db.account.pubkey });
const contacts = await user.follows();
contacts.delete(new NDKUser({ hexpubkey: pubkey }));
contacts.delete(new NDKUser({ pubkey: pubkey }));
let list: string[][];
contacts.forEach((el) =>
list.push(['p', el.pubkey, el.relayUrls?.[0] || '', el.profile?.name || ''])
);
contacts.forEach((el) => list.push(['p', el.pubkey, el.relayUrls?.[0] || '', '']));
const event = new NDKEvent(ndk);
event.content = '';