mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 10:26:33 +02:00
fix duplicate server add when SERVER_LOCK is configured (#1623)
This commit is contained in:
@@ -2,6 +2,7 @@ import { openContextModal } from '@mantine/modals';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { isServerLock } from '/@/renderer/features/action-required/utils/window-properties';
|
||||
import JellyfinLogo from '/@/renderer/features/servers/assets/jellyfin.png';
|
||||
import NavidromeLogo from '/@/renderer/features/servers/assets/navidrome.png';
|
||||
import OpenSubsonicLogo from '/@/renderer/features/servers/assets/opensubsonic.png';
|
||||
@@ -23,6 +24,7 @@ export const ServerList = () => {
|
||||
const { t } = useTranslation();
|
||||
const currentServer = useCurrentServer();
|
||||
const serverListQuery = useServerList();
|
||||
const serverLock = isServerLock();
|
||||
|
||||
const handleAddServerModal = () => {
|
||||
openContextModal({
|
||||
@@ -70,15 +72,17 @@ export const ServerList = () => {
|
||||
</Accordion.Item>
|
||||
);
|
||||
})}
|
||||
<Group grow pt="md">
|
||||
<Button
|
||||
autoFocus
|
||||
leftSection={<Icon icon="add" />}
|
||||
onClick={handleAddServerModal}
|
||||
>
|
||||
{t('form.addServer.title', { postProcess: 'titleCase' })}
|
||||
</Button>
|
||||
</Group>
|
||||
{!serverLock && (
|
||||
<Group grow pt="md">
|
||||
<Button
|
||||
autoFocus
|
||||
leftSection={<Icon icon="add" />}
|
||||
onClick={handleAddServerModal}
|
||||
>
|
||||
{t('form.addServer.title', { postProcess: 'titleCase' })}
|
||||
</Button>
|
||||
</Group>
|
||||
)}
|
||||
</Accordion>
|
||||
{isElectron() && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user