mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 13:00:13 +02:00
render login page on SERVER_LOCK (#1172)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { openModal } from '@mantine/modals';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router';
|
||||
|
||||
@@ -17,8 +16,6 @@ import { Icon } from '/@/shared/components/icon/icon';
|
||||
import { ServerListItemWithCredential, ServerType } from '/@/shared/types/domain-types';
|
||||
import { ServerFeature } from '/@/shared/types/features-types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
export const ServerSelectorItems = () => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
@@ -91,7 +88,7 @@ export const ServerSelectorItems = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const serverLock = localSettings?.env.SERVER_LOCK || false;
|
||||
const isServerLock = Boolean(window.SERVER_LOCK) || false;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -126,7 +123,7 @@ export const ServerSelectorItems = () => {
|
||||
</DropdownMenu.Item>
|
||||
);
|
||||
})}
|
||||
{!serverLock && (
|
||||
{!isServerLock && (
|
||||
<DropdownMenu.Item
|
||||
leftSection={<Icon icon="edit" />}
|
||||
onClick={handleManageServersModal}
|
||||
|
||||
Reference in New Issue
Block a user