mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Add browser forward/back hotkeys (#155)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { lazy } from 'react';
|
||||
import isElectron from 'is-electron';
|
||||
import { useNavigate } from 'react-router';
|
||||
import styled from 'styled-components';
|
||||
import {
|
||||
useWindowSettings,
|
||||
@@ -54,6 +55,7 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
|
||||
const { windowBarStyle } = useWindowSettings();
|
||||
const { opened, ...handlers } = useCommandPalette();
|
||||
const { bindings } = useHotkeySettings();
|
||||
const navigate = useNavigate();
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
const settings = useGeneralSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
@@ -78,6 +80,8 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
|
||||
|
||||
useHotkeys([
|
||||
[bindings.globalSearch.hotkey, () => handlers.open()],
|
||||
[bindings.browserBack.hotkey, () => navigate(-1)],
|
||||
[bindings.browserForward.hotkey, () => navigate(1)],
|
||||
...(isElectron() ? zoomHotkeys : []),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user