mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-18 16:31:46 +03:00
Prompt to double-confirm unfollow
This commit is contained in:
parent
299b638ac3
commit
e5fa7536e0
1 changed files with 7 additions and 2 deletions
|
@ -155,11 +155,16 @@ export default ({ account }) => {
|
||||||
try {
|
try {
|
||||||
let newRelationship;
|
let newRelationship;
|
||||||
if (following) {
|
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 {
|
} else {
|
||||||
newRelationship = await masto.accounts.follow(id);
|
newRelationship = await masto.accounts.follow(id);
|
||||||
}
|
}
|
||||||
setRelationship(newRelationship);
|
if (newRelationship) setRelationship(newRelationship);
|
||||||
setRelationshipUIState('default');
|
setRelationshipUIState('default');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e);
|
alert(e);
|
||||||
|
|
Loading…
Reference in a new issue