mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-15 11:32:09 +03:00
don't memoize roles
always recalculate on component render
This commit is contained in:
parent
026d1c67f2
commit
4ff8168422
@ -381,16 +381,14 @@ export default function AuthenticationView({
|
||||
[t, updateConfig, users, mutateUsers],
|
||||
);
|
||||
|
||||
const roles = useMemo(() => {
|
||||
return config?.auth?.roles
|
||||
? Object.entries(config.auth.roles)
|
||||
.filter(([name]) => name !== "admin")
|
||||
.map(([name, data]) => ({
|
||||
name,
|
||||
cameras: Array.isArray(data) ? data : [],
|
||||
}))
|
||||
: [];
|
||||
}, [config]);
|
||||
const roles = config?.auth?.roles
|
||||
? Object.entries(config.auth.roles)
|
||||
.filter(([name]) => name !== "admin")
|
||||
.map(([name, data]) => ({
|
||||
name,
|
||||
cameras: Array.isArray(data) ? data : [],
|
||||
}))
|
||||
: [];
|
||||
|
||||
const availableRoles = useMemo(() => {
|
||||
return config ? [...Object.keys(config.auth?.roles || {})] : [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user