Handle escape on labels modal

This commit is contained in:
Jackson Harper 2023-06-19 22:08:13 +08:00
parent 3683447b6e
commit defef6917a

View file

@ -251,6 +251,14 @@ export default function Home(): JSX.Element {
name: 'Back to library',
shortcut: ['escape'],
perform: () => {
if (
readerSettings.showSetLabelsModal ||
readerSettings.showDeleteConfirmation ||
readerSettings.showDeleteConfirmation ||
readerSettings.showEditDisplaySettingsModal
) {
return
}
const query = window.sessionStorage.getItem('q')
if (query) {
router.push(`/home?${query}`)
@ -353,7 +361,7 @@ export default function Home(): JSX.Element {
perform: () => setShowEditModal(true),
},
],
[]
[readerSettings]
)
if (articleFetchError && articleFetchError.indexOf('NOT_FOUND') > -1) {