useFollow: don't go below 0
This commit is contained in:
@ -30,7 +30,7 @@ function useFollow() {
|
||||
function decrementFollowers(accountId: string) {
|
||||
changeAccount(accountId, (account) => ({
|
||||
...account,
|
||||
followers_count: account.followers_count - 1,
|
||||
followers_count: Math.max(0, account.followers_count - 1),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user