Skip to content

Commit

Permalink
fix: force reload on error page
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat committed May 12, 2022
1 parent 788fdd1 commit bade869
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 96 deletions.
5 changes: 5 additions & 0 deletions electron/app/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export const saveFileDialog = (event: Electron.IpcMainInvokeEvent, options: File
return dialog.showSaveDialogSync(dialogOptions);
};

export const forceLoad = (event: Electron.IpcMainInvokeEvent) => {
const browserWindow = BrowserWindow.fromId(event.sender.id);
browserWindow?.webContents.reloadIgnoringCache();
};

/**
* Checks for a new version of monokle
*/
Expand Down
13 changes: 12 additions & 1 deletion electron/app/ipc/ipcListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ import {UPDATE_APPLICATION, trackEvent} from '@utils/telemetry';

import {getAmplitudeClient} from '../amplitude';
import autoUpdater from '../autoUpdater';
import {checkNewVersion, interpolateTemplate, runCommand, saveFileDialog, selectFileDialog} from '../commands';
import {
checkNewVersion,
forceLoad as forceReload,
interpolateTemplate,
runCommand,
saveFileDialog,
selectFileDialog,
} from '../commands';
import {downloadPlugin, updatePlugin} from '../services/pluginService';
import {
downloadTemplate,
Expand Down Expand Up @@ -240,6 +247,10 @@ ipcMain.on('quit-and-install', () => {
dispatchToAllWindows(updateNewVersion({code: NewVersionCode.Idle, data: null}));
});

ipcMain.on('force-reload', async (event: any) => {
forceReload(event);
});

ipcMain.on('confirm-action', (event: any, args) => {
event.returnValue = askActionConfirmation(args);
});
Expand Down
Loading

0 comments on commit bade869

Please sign in to comment.