fix unfollow dialog

This commit is contained in:
SrGooglo 2023-08-15 18:21:52 +00:00
parent ae41fe06cc
commit 6b13136fa6

View File

@ -65,31 +65,33 @@ export default class Account extends React.Component {
} }
toggleLike = async () => { toggleLike = async () => {
const accept = await new Promise((resolve, reject) => { if (this.state.isFollowed) {
antd.Modal.confirm({ const accept = await new Promise((resolve, reject) => {
title: <Translation> antd.Modal.confirm({
{t => t("Confirm")} title: <Translation>
</Translation>, {t => t("Confirm")}
content: <Translation> </Translation>,
{t => t("Are you sure you want to unfollow this user?")} content: <Translation>
</Translation>, {t => t("Are you sure you want to unfollow this user?")}
okText: <Translation> </Translation>,
{t => t("Yes")} okText: <Translation>
</Translation>, {t => t("Yes")}
cancelText: <Translation> </Translation>,
{t => t("No")} cancelText: <Translation>
</Translation>, {t => t("No")}
onOk: () => { </Translation>,
resolve(true) onOk: () => {
}, resolve(true)
onCancel: () => { },
resolve(false) onCancel: () => {
} resolve(false)
}
})
}) })
})
if (!accept) { if (!accept) {
return false return false
}
} }
const result = await FollowsModel.toggleFollow({ const result = await FollowsModel.toggleFollow({