# 删除用户失败时，警报对话框未正确弹出

**URL:** <https://meta.discourse.org/t/when-deleting-a-user-fails-the-alert-dialog-did-not-pop-up-properly/257699>\
**Category:** Bug\
**Created:** [2023年三月10日 13:14 UTC](https://meta.discourse.org/t/when-deleting-a-user-fails-the-alert-dialog-did-not-pop-up-properly/257699 "2023-03-10T13:14:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)\
**Post date:** [2023年三月10日 13:14 UTC](https://meta.discourse.org/t/when-deleting-a-user-fails-the-alert-dialog-did-not-pop-up-properly/257699/1 "2023-03-10T13:14:18Z")

</div>

在我最近的测试中，我发现当用户在“偏好设置”中无法删除自己时，相应的错误对话框没有正常弹出。

阅读源代码后，我怀疑这行代码缺少对 `next` 的调用。

> <https://github.com/discourse/discourse/blob/3e8d3494651c50751ec248506a9e4a13137e5c6b/app/assets/javascripts/discourse/app/controllers/preferences/account.js#L219>

我在开发环境中修改了这一行，如下所示：  
`next(() => this.dialog.alert(I18n.t("user.delete_yourself_not_allowed")));`  
然后我发现对话框正常弹出了。

我对 ember 不是很熟悉，所以我不知道这个修改是否正确，但这里似乎肯定存在一个 bug。
