Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

Commit

Permalink
Added cache removal buttons
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoli Nicolae <[email protected]>
  • Loading branch information
anatolinicolae committed May 27, 2017
1 parent 19191f5 commit af11713
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ const template = [{
if (focusedWindow) focusedWindow.reload()
}
},
{
label: 'Clear cache',
click (item, focusedWindow) {
if (focusedWindow)
focusedWindow.webContents.session.clearCache(() => {
dialog.showMessageBox({
message: 'Cache cleared correctly!'
})
focusedWindow.reload()
})
}
},
{
type: 'separator'
},
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/tray.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const path = require('path')
const {
app,
dialog,
session,
shell,
Tray,
Menu
Expand Down Expand Up @@ -46,6 +48,16 @@ exports.createTray = win => {
toggleWin()
}
},
{
label: 'Clear cache',
click () {
win.webContents.session.clearCache(() => {
dialog.showMessageBox({
message: 'Cache cleared correctly!'
})
})
}
},
{
type: 'separator'
},
Expand Down

0 comments on commit af11713

Please sign in to comment.