mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 14:54:12 +00:00
Merge pull request #102 from manojVivek/feature/reload-ignoring-cache
Fixed #98 - Reload ignoring cache with Cmd/Ctrl + Shift + r
This commit is contained in:
commit
d895f30a66
3 changed files with 40 additions and 4 deletions
|
@ -351,8 +351,9 @@ export function triggerNavigationForward() {
|
|||
};
|
||||
}
|
||||
|
||||
export function triggerNavigationReload() {
|
||||
export function triggerNavigationReload(_, args) {
|
||||
return (dispatch: Dispatch, getState: RootStateType) => {
|
||||
pubsub.publish(NAVIGATION_RELOAD);
|
||||
const ignoreCache = (args || {}).ignoreCache;
|
||||
pubsub.publish(NAVIGATION_RELOAD, [{ignoreCache}]);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -200,7 +200,10 @@ class WebView extends Component {
|
|||
this.webviewRef.current.goForward();
|
||||
};
|
||||
|
||||
processNavigationReloadEvent = () => {
|
||||
processNavigationReloadEvent = ({ignoreCache}) => {
|
||||
if (ignoreCache) {
|
||||
return this.webviewRef.current.reloadIgnoringCache();
|
||||
}
|
||||
this.webviewRef.current.reload();
|
||||
};
|
||||
|
||||
|
|
|
@ -157,11 +157,18 @@ export default class MenuBuilder {
|
|||
submenu: [
|
||||
{
|
||||
label: 'Reload',
|
||||
accelerator: 'Command+R',
|
||||
accelerator: 'CommandOrControl+R',
|
||||
click: () => {
|
||||
this.mainWindow.webContents.reload();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Reload Ignoring Cache',
|
||||
accelerator: 'CommandOrControl+Shift+R',
|
||||
click: () => {
|
||||
this.mainWindow.webContents.send('reload-url', {ignoreCache: true});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Toggle Full Screen',
|
||||
accelerator: 'Ctrl+Command+F',
|
||||
|
@ -188,6 +195,13 @@ export default class MenuBuilder {
|
|||
this.mainWindow.webContents.send('reload-url');
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Reload Ignoring Cache',
|
||||
accelerator: 'CommandOrControl+Shift+R',
|
||||
click: () => {
|
||||
this.mainWindow.webContents.send('reload-url', {ignoreCache: true});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Toggle Full Screen',
|
||||
accelerator: 'Ctrl+Command+F',
|
||||
|
@ -243,6 +257,15 @@ export default class MenuBuilder {
|
|||
this.mainWindow.webContents.reload();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Reload Ignoring Cache',
|
||||
accelerator: 'CommandOrControl+Shift+R',
|
||||
click: () => {
|
||||
this.mainWindow.webContents.send('reload-url', {
|
||||
ignoreCache: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Toggle &Full Screen',
|
||||
accelerator: 'F11',
|
||||
|
@ -268,6 +291,15 @@ export default class MenuBuilder {
|
|||
this.mainWindow.webContents.send('reload-url');
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Reload Ignoring Cache',
|
||||
accelerator: 'CommandOrControl+Shift+R',
|
||||
click: () => {
|
||||
this.mainWindow.webContents.send('reload-url', {
|
||||
ignoreCache: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Toggle &Full Screen',
|
||||
accelerator: 'F11',
|
||||
|
|
Loading…
Reference in a new issue