mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
fix unfollow dialog
This commit is contained in:
parent
ae41fe06cc
commit
6b13136fa6
@ -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({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user