feat: add mouse navigation
Simple support for back/forward mouse buttons. Need to test on Mac and Linux.
This commit is contained in:
parent
33ec088006
commit
525de82d36
2 changed files with 20 additions and 1 deletions
|
@ -73,6 +73,17 @@ export default appState => {
|
|||
|
||||
setupBarMenu();
|
||||
|
||||
window.on('app-command', function(e, cmd) {
|
||||
switch (cmd) {
|
||||
case 'browser-backward':
|
||||
window.webContents.send('navigate-backward', null);
|
||||
return;
|
||||
case 'browser-forward':
|
||||
window.webContents.send('navigate-forward', null);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
window.on('close', event => {
|
||||
if (!appState.isQuitting && !appState.autoUpdateAccepted) {
|
||||
event.preventDefault();
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
doHideModal,
|
||||
} from 'redux/actions/app';
|
||||
import { doToast, doBlackListedOutpointsSubscribe, isURIValid, setSearchApi } from 'lbry-redux';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { doNavigate, doHistoryBack, doHistoryForward } from 'redux/actions/navigation';
|
||||
import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings';
|
||||
import { doAuthenticate, Lbryio, rewards } from 'lbryinc';
|
||||
import 'scss/all.scss';
|
||||
|
@ -41,6 +41,14 @@ if (process.env.SEARCH_API_URL) {
|
|||
setSearchApi(process.env.SEARCH_API_URL);
|
||||
}
|
||||
|
||||
ipcRenderer.on('navigate-backward', () => {
|
||||
app.store.dispatch(doHistoryBack());
|
||||
});
|
||||
|
||||
ipcRenderer.on('navigate-forward', () => {
|
||||
app.store.dispatch(doHistoryForward());
|
||||
});
|
||||
|
||||
// We need to override Lbryio for getting/setting the authToken
|
||||
// We interect with ipcRenderer to get the auth key from a users keyring
|
||||
// We keep a local variable for authToken beacuse `ipcRenderer.send` does not
|
||||
|
|
Loading…
Add table
Reference in a new issue