Skip to content

Commit

Permalink
marked polling-interval option to off and disabled other polling opti…
Browse files Browse the repository at this point in the history
…ons if readonly mode is enabled (#790)

closes #790
  • Loading branch information
jb-abhi authored Aug 4, 2024
1 parent 991175d commit 61a5ac9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ui/src/components/SettingsModal/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { SelectField } from '../Form/SelectField/SelectField';
import { SwitchField } from '../Form/SwitchField/SwitchField';
import { Modal } from '../Modal/Modal';
import { availableJobTabs } from '../../hooks/useDetailsTabs';
import { useActiveQueue } from '../../hooks/useActiveQueue';

export interface SettingsModalProps {
open: boolean;

onClose(): void;
}

const pollingIntervals = [-1, 3, 5, 10, 20, 60, 60 * 5, 60 * 15];
const allPollingIntervals = [-1, 3, 5, 10, 20, 60, 60 * 5, 60 * 15];

export const SettingsModal = ({ open, onClose }: SettingsModalProps) => {
const {
Expand All @@ -31,6 +32,8 @@ export const SettingsModal = ({ open, onClose }: SettingsModalProps) => {
} = useSettingsStore((state) => state);
const { t, i18n } = useTranslation();
const languages = ['en-US', 'fr-FR', 'pt-BR', 'zh-CN'];
const queue = useActiveQueue();
const pollingIntervals = queue?.readOnlyMode ? [-1] : allPollingIntervals;

return (
<Modal width="small" open={open} onClose={onClose} title={t('SETTINGS.TITLE')}>
Expand Down

0 comments on commit 61a5ac9

Please sign in to comment.