From 50006d336b15225b576cce69aa81df16137bb20b Mon Sep 17 00:00:00 2001 From: bob Date: Fri, 27 May 2022 17:29:19 +0900 Subject: [PATCH] useModal --- src/main/index.js | 4 ++-- .../components/ft-video-player/ft-video-player.js | 10 +++++----- src/renderer/store/modules/utils.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 501307caf337..900ea26978be 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -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 }) diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index d4d38eb38756..6e9eb6ee1c95 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -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({ @@ -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) { @@ -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() } diff --git a/src/renderer/store/modules/utils.js b/src/renderer/store/modules/utils.js index bf979d4497fd..a2fe9851e2f5 100644 --- a/src/renderer/store/modules/utils.js +++ b/src/renderer/store/modules/utils.js @@ -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) {