1
0
Fork 0

Prompt to double-confirm unfollow

This commit is contained in:
Lim Chee Aun 2022-12-12 10:03:41 +08:00
parent 299b638ac3
commit e5fa7536e0

View file

@ -155,11 +155,16 @@ export default ({ account }) => {
try {
let newRelationship;
if (following) {
newRelationship = await masto.accounts.unfollow(id);
const yes = confirm(
'Are you sure that you want to unfollow this account?',
);
if (yes) {
newRelationship = await masto.accounts.unfollow(id);
}
} else {
newRelationship = await masto.accounts.follow(id);
}
setRelationship(newRelationship);
if (newRelationship) setRelationship(newRelationship);
setRelationshipUIState('default');
} catch (e) {
alert(e);