a
This commit is contained in:
parent
3ef66fb54a
commit
fac2651911
|
|
@ -98,6 +98,9 @@ function App() {
|
||||||
}
|
}
|
||||||
}, [showUserPopover])
|
}, [showUserPopover])
|
||||||
|
|
||||||
|
// 必须在定义 effectiveUserId 之前定义 isAdmin
|
||||||
|
const isAdmin = (me?.role || '') === 'admin'
|
||||||
|
|
||||||
// 当前查看的用户信息
|
// 当前查看的用户信息
|
||||||
const currentViewingUser = users.find((u) => parseInt(String(u?.id || ''), 10) === viewingUserId)
|
const currentViewingUser = users.find((u) => parseInt(String(u?.id || ''), 10) === viewingUserId)
|
||||||
const effectiveUserId = isAdmin && viewingUserId ? viewingUserId : parseInt(String(me?.id || ''), 10)
|
const effectiveUserId = isAdmin && viewingUserId ? viewingUserId : parseInt(String(me?.id || ''), 10)
|
||||||
|
|
@ -118,8 +121,6 @@ function App() {
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const isAdmin = (me?.role || '') === 'admin'
|
|
||||||
|
|
||||||
if (checking) {
|
if (checking) {
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user