Skip to content

Commit

Permalink
Re-enable shell via main.js to fix the "Open file" button
Browse files Browse the repository at this point in the history
  • Loading branch information
jely2002 committed Sep 27, 2020
1 parent ed5e8c4 commit 2313af3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain, nativeImage, dialog, Menu, globalShortcut} = require('electron')
const { app, BrowserWindow, ipcMain, nativeImage, dialog, Menu, globalShortcut, shell} = require('electron')
const { autoUpdater } = require("electron-updater")
const fs = require('fs')
const mkdirp = require('mkdirp')
Expand Down Expand Up @@ -223,6 +223,10 @@ ipcMain.handle('titlebarClick', (event, arg) => {
}
})

ipcMain.handle('showItemInFolder', (event, arg) => {
shell.showItemInFolder(arg)
})

//Check if user has enabled auto-updating the app
function isUpdateEnabled() {
let settingsPath
Expand Down
8 changes: 4 additions & 4 deletions modules/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ function openDownloadedFile() {
} else {
if(mediaMode === "audio") {
if(process.platform === "darwin" || process.platform === "linux") {
shell.showItemInFolder(downloadPath + '/' + audioOutputName.replace(/[//?%*:|"<>]/g, '_'))
ipcRenderer.invoke('showItemInFolder', + '/' + audioOutputName.replace(/[//?%*:|"<>]/g, '_'))
} else {
shell.showItemInFolder(downloadPath + '\\' + audioOutputName.replace(/[/\\?%*:|"<>]/g, '_'))
ipcRenderer.invoke('showItemInFolder', + '\\' + audioOutputName.replace(/[/\\?%*:|"<>]/g, '_'))
}
} else {
if(process.platform === "darwin" || process.platform === "linux") {
shell.showItemInFolder(downloadPath + '/' + videoOutputName.replace(/[//?%*:|"<>]/g, '_'))
ipcRenderer.invoke('showItemInFolder', downloadPath + '/' + videoOutputName.replace(/[//?%*:|"<>]/g, '_'))
} else {
shell.showItemInFolder(downloadPath + '\\' + videoOutputName.replace(/[/\\?%*:|"<>]/g, '_'))
ipcRenderer.invoke('showItemInFolder', downloadPath + '\\' + videoOutputName.replace(/[/\\?%*:|"<>]/g, '_'))
}
}
}
Expand Down

0 comments on commit 2313af3

Please sign in to comment.