Remove use-history-nav.js
For electron.js only
This commit is contained in:
parent
d7fc5069be
commit
45ad08ec32
2 changed files with 0 additions and 33 deletions
|
@ -21,9 +21,6 @@ import usePersistedState from 'effects/use-persisted-state';
|
|||
import Spinner from 'component/spinner';
|
||||
import LANGUAGES from 'constants/languages';
|
||||
|
||||
// @if TARGET='app'
|
||||
import useHistoryNav from 'effects/use-history-nav';
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
import YoutubeWelcome from 'web/component/youtubeReferralWelcome';
|
||||
import {
|
||||
|
@ -235,11 +232,6 @@ function App(props: Props) {
|
|||
return () => window.removeEventListener('keydown', handleKeyPress);
|
||||
}, []);
|
||||
|
||||
// Enable 'Alt + Left/Right' for history navigation on Desktop.
|
||||
// @if TARGET='app'
|
||||
useHistoryNav(history);
|
||||
// @endif
|
||||
|
||||
useEffect(() => {
|
||||
if (referredRewardAvailable && sanitizedReferrerParam && isRewardApproved) {
|
||||
setReferrer(sanitizedReferrerParam, true);
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
import { useEffect } from 'react';
|
||||
|
||||
export default function useHistoryNav(history) {
|
||||
useEffect(() => {
|
||||
const handleKeyPress = e => {
|
||||
if ((e.metaKey || e.altKey) && !e.ctrlKey && !e.shiftKey) {
|
||||
switch (e.code) {
|
||||
case 'ArrowLeft':
|
||||
e.preventDefault();
|
||||
history.goBack();
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
e.preventDefault();
|
||||
history.goForward();
|
||||
break;
|
||||
default:
|
||||
// Do nothing
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', handleKeyPress);
|
||||
return () => window.removeEventListener('keydown', handleKeyPress);
|
||||
}, []);
|
||||
}
|
Loading…
Reference in a new issue