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],
|
[t, updateConfig, users, mutateUsers],
|
||||||
);
|
);
|
||||||
|
|
||||||
const roles = useMemo(() => {
|
const roles = config?.auth?.roles
|
||||||
return config?.auth?.roles
|
? Object.entries(config.auth.roles)
|
||||||
? Object.entries(config.auth.roles)
|
.filter(([name]) => name !== "admin")
|
||||||
.filter(([name]) => name !== "admin")
|
.map(([name, data]) => ({
|
||||||
.map(([name, data]) => ({
|
name,
|
||||||
name,
|
cameras: Array.isArray(data) ? data : [],
|
||||||
cameras: Array.isArray(data) ? data : [],
|
}))
|
||||||
}))
|
: [];
|
||||||
: [];
|
|
||||||
}, [config]);
|
|
||||||
|
|
||||||
const availableRoles = useMemo(() => {
|
const availableRoles = useMemo(() => {
|
||||||
return config ? [...Object.keys(config.auth?.roles || {})] : [];
|
return config ? [...Object.keys(config.auth?.roles || {})] : [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user