forked from Kieran/snort
fix: follow button response
This commit is contained in:
parent
2c31a37b6a
commit
09a9364163
@ -24,8 +24,8 @@ export default function FollowButton(props: FollowButtonProps) {
|
|||||||
async function follow(pubkey: HexKey) {
|
async function follow(pubkey: HexKey) {
|
||||||
if (publisher) {
|
if (publisher) {
|
||||||
const ev = await publisher.contactList([pubkey, ...follows.item], relays.item);
|
const ev = await publisher.contactList([pubkey, ...follows.item], relays.item);
|
||||||
await FollowsFeed.backFill(System, [pubkey]);
|
|
||||||
System.BroadcastEvent(ev);
|
System.BroadcastEvent(ev);
|
||||||
|
await FollowsFeed.backFill(System, [pubkey]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,9 +43,9 @@ export default function FollowButton(props: FollowButtonProps) {
|
|||||||
<AsyncButton
|
<AsyncButton
|
||||||
className={isFollowing ? `${baseClassname} secondary` : `${baseClassname} primary`}
|
className={isFollowing ? `${baseClassname} secondary` : `${baseClassname} primary`}
|
||||||
disabled={readonly}
|
disabled={readonly}
|
||||||
onClick={e => {
|
onClick={async e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
isFollowing ? unfollow(pubkey) : follow(pubkey);
|
await (isFollowing ? unfollow(pubkey) : follow(pubkey))
|
||||||
}}>
|
}}>
|
||||||
{isFollowing ? <FormattedMessage {...messages.Unfollow} /> : <FormattedMessage {...messages.Follow} />}
|
{isFollowing ? <FormattedMessage {...messages.Unfollow} /> : <FormattedMessage {...messages.Follow} />}
|
||||||
</AsyncButton>
|
</AsyncButton>
|
||||||
|
Loading…
Reference in New Issue
Block a user