mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 20:40:21 +02:00
[enhancement]: support clearing query and http cache (#475)
* [enhancement]: support clearing query and http cache - Adds the ability to invalidate all queries (useful for forcing refresh, and clearing lyrics which are cached forever) - [Desktop only] adds the ability to clear the Electron HTTP cache (e.g. cached images) * use clearer language * move cache settings to general
This commit is contained in:
@@ -260,6 +260,10 @@ const createWindow = async () => {
|
||||
app.exit();
|
||||
});
|
||||
|
||||
ipcMain.handle('window-clear-cache', async () => {
|
||||
return mainWindow?.webContents.session.clearCache();
|
||||
});
|
||||
|
||||
ipcMain.on('app-restart', () => {
|
||||
// Fix for .AppImage
|
||||
if (process.env.APPIMAGE) {
|
||||
|
||||
@@ -24,7 +24,12 @@ const devtools = () => {
|
||||
ipcRenderer.send('window-dev-tools');
|
||||
};
|
||||
|
||||
const clearCache = (): Promise<void> => {
|
||||
return ipcRenderer.invoke('window-clear-cache');
|
||||
};
|
||||
|
||||
export const browser = {
|
||||
clearCache,
|
||||
devtools,
|
||||
exit,
|
||||
maximize,
|
||||
@@ -32,3 +37,5 @@ export const browser = {
|
||||
quit,
|
||||
unmaximize,
|
||||
};
|
||||
|
||||
export type Browser = typeof browser;
|
||||
|
||||
Reference in New Issue
Block a user