mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 21:10:12 +02:00
render login page on SERVER_LOCK (#1172)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { openModal } from '@mantine/modals';
|
||||
import isElectron from 'is-electron';
|
||||
import { Dispatch, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router';
|
||||
@@ -10,8 +9,6 @@ import { AppRoute } from '/@/renderer/router/routes';
|
||||
import { useAuthStoreActions, useServerList } from '/@/renderer/store';
|
||||
import { ServerListItemWithCredential } from '/@/shared/types/domain-types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
interface ServerCommandsProps {
|
||||
handleClose: () => void;
|
||||
setPages: (pages: CommandPalettePages[]) => void;
|
||||
@@ -45,7 +42,7 @@ export const ServerCommands = ({ handleClose, setPages, setQuery }: ServerComman
|
||||
[handleClose, navigate, setCurrentServer, setPages, setQuery],
|
||||
);
|
||||
|
||||
const serverLock = localSettings?.env.SERVER_LOCK || false;
|
||||
const isServerLock = Boolean(window.SERVER_LOCK) || false;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -59,7 +56,7 @@ export const ServerCommands = ({ handleClose, setPages, setQuery }: ServerComman
|
||||
>{`${serverList[key].name}...`}</Command.Item>
|
||||
))}
|
||||
</Command.Group>
|
||||
{!serverLock && (
|
||||
{!isServerLock && (
|
||||
<Command.Group heading={t('common.manage', { postProcess: 'sentenceCase' })}>
|
||||
<Command.Item onSelect={handleManageServersModal}>
|
||||
{t('page.appMenu.manageServers', { postProcess: 'sentenceCase' })}...
|
||||
|
||||
Reference in New Issue
Block a user