fix: follow button response

This commit is contained in:
Kieran 2023-10-11 09:40:54 +01:00
parent 2c31a37b6a
commit 09a9364163
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

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