Skip to content

Commit 86ff34c

Browse files
committed
fix: Hide pause all button if all queues are in readOnlyMode
1 parent 616afbd commit 86ff34c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

packages/ui/src/components/OverviewDropDownActions/OverviewDropDownActions.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const OverviewActions = ({
5454
}
5555

5656
const areAllPaused = queues.every((queue) => queue.isPaused);
57+
const areAllReadOnly = queues.every((queue) => queue.readOnlyMode);
5758
const SortDirection = sortDirection === 'asc' ? <SortDirectionDown /> : <SortDirectionUp />;
5859

5960
return (
@@ -66,18 +67,22 @@ export const OverviewActions = ({
6667

6768
<Portal>
6869
<Content className={s.content} align="end">
69-
{areAllPaused ? (
70-
<Item onClick={actions.resumeAll}>
71-
<PlayIcon />
72-
{t('QUEUE.ACTIONS.RESUME_ALL')}
73-
</Item>
74-
) : (
75-
<Item onClick={actions.pauseAll}>
76-
<PauseIcon />
77-
{t('QUEUE.ACTIONS.PAUSE_ALL')}
78-
</Item>
70+
{areAllReadOnly ? null : (
71+
<>
72+
{areAllPaused ? (
73+
<Item onClick={actions.resumeAll}>
74+
<PlayIcon />
75+
{t('QUEUE.ACTIONS.RESUME_ALL')}
76+
</Item>
77+
) : (
78+
<Item onClick={actions.pauseAll}>
79+
<PauseIcon />
80+
{t('QUEUE.ACTIONS.PAUSE_ALL')}
81+
</Item>
82+
)}
83+
<Separator />
84+
</>
7985
)}
80-
<Separator />
8186
<Sub>
8287
<SubTrigger className={s.subTrigger}>
8388
<SortIcon />

0 commit comments

Comments
 (0)