Skip to content

Commit

Permalink
useModal
Browse files Browse the repository at this point in the history
  • Loading branch information
hockerschwan committed May 27, 2022
1 parent 602f1dc commit 50006d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ function runApp() {
return await dialog.showOpenDialog(options)
})

ipcMain.handle(IpcChannels.SHOW_SAVE_DIALOG, async (event, { options, modal }) => {
if (modal) {
ipcMain.handle(IpcChannels.SHOW_SAVE_DIALOG, async (event, { options, useModal }) => {
if (useModal) {
const senderWindow = BrowserWindow.getAllWindows().find((window) => {
return window.webContents.id === event.sender.id
})
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,10 @@ export default Vue.extend({
canvas.height = height
canvas.getContext('2d').drawImage(video, 0, 0)

const format = this.screenshotFormat
const mimeType = `image/${format === 'jpg' ? 'jpeg' : format}`
const imageQuality = format === 'jpg' ? this.screenshotQuality / 100 : 1

let filename
try {
filename = await this.parseScreenshotCustomFileName({
Expand All @@ -1276,10 +1280,6 @@ export default Vue.extend({
return
}

const format = this.screenshotFormat
const mimeType = `image/${format === 'jpg' ? 'jpeg' : format}`
const imageQuality = format === 'jpg' ? this.screenshotQuality / 100 : 1

const dirChar = process.platform === 'win32' ? '\\' : '/'
let subDir = ''
if (filename.indexOf(dirChar) !== -1) {
Expand Down Expand Up @@ -1313,7 +1313,7 @@ export default Vue.extend({
]
}

const response = await this.showSaveDialog({ options, modal: true })
const response = await this.showSaveDialog({ options, useModal: true })
if (wasPlaying) {
this.player.play()
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/store/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ const actions = {
return await invokeIRC(context, IpcChannels.SHOW_OPEN_DIALOG, webCbk, options)
},

async showSaveDialog (context, { options, modal = false }) {
async showSaveDialog (context, { options, useModal = false }) {
// TODO: implement showSaveDialog web compatible callback
const webCbk = () => null
return await invokeIRC(context, IpcChannels.SHOW_SAVE_DIALOG, webCbk, { options, modal })
return await invokeIRC(context, IpcChannels.SHOW_SAVE_DIALOG, webCbk, { options, useModal })
},

async getUserDataPath (context) {
Expand Down

0 comments on commit 50006d3

Please sign in to comment.