From d988ac814c14de12da73249abd35872b501a87b4 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Wed, 6 Mar 2024 20:30:34 +0800 Subject: [PATCH] fix: fix account items display error (#2781) --- web/src/UserEditPage.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js index 25fccfb1..1bdd8d31 100644 --- a/web/src/UserEditPage.js +++ b/web/src/UserEditPage.js @@ -251,22 +251,8 @@ class UserEditPage extends React.Component { }; renderAccountItem(accountItem) { - if (!accountItem.visible) { - return null; - } - const isAdmin = Setting.isLocalAdminUser(this.props.account); - if (accountItem.viewRule === "Self") { - if (!this.isSelfOrAdmin()) { - return null; - } - } else if (accountItem.viewRule === "Admin") { - if (!isAdmin) { - return null; - } - } - let disabled = false; if (accountItem.modifyRule === "Self") { if (!this.isSelfOrAdmin()) { @@ -1023,6 +1009,21 @@ class UserEditPage extends React.Component {
{ this.getUserOrganization()?.accountItems?.map(accountItem => { + if (!accountItem.visible) { + return null; + } + + const isAdmin = Setting.isLocalAdminUser(this.props.account); + + if (accountItem.viewRule === "Self") { + if (!this.isSelfOrAdmin()) { + return null; + } + } else if (accountItem.viewRule === "Admin") { + if (!isAdmin) { + return null; + } + } return (