update personal dashboard screen
This commit is contained in:
@@ -29,9 +29,9 @@ export const UserWithDrawer = memo(function UserWithDrawer({
|
||||
|
||||
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);
|
||||
@@ -45,14 +45,12 @@ export const UserWithDrawer = memo(function UserWithDrawer({
|
||||
|
||||
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 = '';
|
||||
|
||||
Reference in New Issue
Block a user