4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-11 17:55:51 +00:00

Add clear cache

This commit is contained in:
AlphaX-Projects 2023-07-23 18:01:30 +02:00
parent 3b26e82d42
commit 38c4c7baa2
2 changed files with 20 additions and 12 deletions

View File

@ -1,16 +1,17 @@
const {
app,
BrowserWindow,
ipcMain,
ipcRenderer,
Menu,
Notification,
Tray,
nativeImage,
dialog,
webContents,
nativeTheme,
crashReporter
app,
BrowserWindow,
ipcMain,
ipcRenderer,
Menu,
Notification,
Tray,
nativeImage,
dialog,
webContents,
nativeTheme,
crashReporter,
webFrame
} = require('electron')
const { autoUpdater } = require('electron-updater')
@ -1031,6 +1032,12 @@ if (!isLock) {
}
})
})
ipcMain.on('clear-all-cache', (event) => {
const theWindows = BrowserWindow.getAllWindows()[0]
const ses = theWindows.webContents.session
console.clear()
ses.clearCache()
})
ipcMain.on('check-for-update', (event) => {
const check = new Notification({
title: i18n.__("electron_translate_43"),

View File

@ -5,4 +5,5 @@ contextBridge.exposeInMainWorld('electronAPI', {
checkForUpdate: () => ipcRenderer.send('check-for-update'),
showMyMenu: () => ipcRenderer.send('show-my-menu'),
focusApp: () => ipcRenderer.send('focus-app'),
clearMyCache: () => ipcRenderer.send('clear-all-cache'),
})