mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Remove unnecessary computed value
This commit is contained in:
@@ -15,7 +15,7 @@ import {configState} from "Frontend/state/ConfigState";
|
|||||||
function UserManagementLayout({getConfig, formik}: any) {
|
function UserManagementLayout({getConfig, formik}: any) {
|
||||||
const inviteUserModal = useDisclosure();
|
const inviteUserModal = useDisclosure();
|
||||||
const [users, setUsers] = useState<UserInfoDto[]>([]);
|
const [users, setUsers] = useState<UserInfoDto[]>([]);
|
||||||
const autoRegisterNewUsers = useSnapshot(configState);
|
const config = useSnapshot(configState);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
UserEndpoint.getAllUsers().then(
|
UserEndpoint.getAllUsers().then(
|
||||||
@@ -35,7 +35,7 @@ function UserManagementLayout({getConfig, formik}: any) {
|
|||||||
|
|
||||||
<div className="flex flex-row items-baseline justify-between">
|
<div className="flex flex-row items-baseline justify-between">
|
||||||
<h2 className="text-xl font-bold mt-8 mb-1">Users</h2>
|
<h2 className="text-xl font-bold mt-8 mb-1">Users</h2>
|
||||||
{!autoRegisterNewUsers &&
|
{!config.configEntries["sso.oidc.auto-register-new-users"].value &&
|
||||||
<SmallInfoField className="mb-4 text-warning" icon={Info}
|
<SmallInfoField className="mb-4 text-warning" icon={Info}
|
||||||
message="Automatic user registration for SSO users is disabled"/>
|
message="Automatic user registration for SSO users is disabled"/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,17 +7,13 @@ type ConfigState = {
|
|||||||
isLoaded: boolean;
|
isLoaded: boolean;
|
||||||
configEntries: Record<string, ConfigEntryDto>;
|
configEntries: Record<string, ConfigEntryDto>;
|
||||||
configNested: NestedConfig;
|
configNested: NestedConfig;
|
||||||
autoRegisterNewUsers: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const configState = proxy<ConfigState>({
|
export const configState = proxy<ConfigState>({
|
||||||
configEntries: {},
|
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
|
configEntries: {},
|
||||||
get configNested() {
|
get configNested() {
|
||||||
return toNestedConfig(Object.values(this.configEntries));
|
return toNestedConfig(Object.values(this.configEntries));
|
||||||
},
|
|
||||||
get autoRegisterNewUsers() {
|
|
||||||
return this.configNested["sso.oidc.auto-register-new-users"] as boolean;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user