mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Disable keyboard shorcuts when modals are open in the library
This commit is contained in:
parent
99cab91d40
commit
51d723f3fb
1 changed files with 7 additions and 1 deletions
|
|
@ -236,8 +236,14 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
|
|||
return
|
||||
}
|
||||
|
||||
// If any of the modals are open we disable handling keyboard shortcuts
|
||||
if (labelsTarget || snoozeTarget || shareTarget) {
|
||||
return
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case 'showDetail':
|
||||
|
||||
const username = viewerData?.me?.profile.username
|
||||
if (username) {
|
||||
setActiveCardId(item.node.id)
|
||||
|
|
@ -272,7 +278,6 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
|
|||
setSnoozeTarget(item)
|
||||
break
|
||||
case 'set-labels':
|
||||
console.log('setting labels target', item.node.id)
|
||||
setLabelsTarget(item)
|
||||
break
|
||||
}
|
||||
|
|
@ -733,6 +738,7 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
|
|||
if (props.labelsTarget) {
|
||||
props.labelsTarget.node.labels = value as (Label[] | undefined)
|
||||
}
|
||||
break
|
||||
}
|
||||
}}
|
||||
onOpenChange={() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue