From 358064ecd487dd69b635531eb0e2611f14ae5c7c Mon Sep 17 00:00:00 2001 From: viarotel Date: Tue, 29 Oct 2024 09:05:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Resolve=20default=20recor?= =?UTF-8?q?ding=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MoreDropdown/components/Record/index.vue | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/Device/components/MoreDropdown/components/Record/index.vue b/src/components/Device/components/MoreDropdown/components/Record/index.vue index 68e5669..c769dbe 100644 --- a/src/components/Device/components/MoreDropdown/components/Record/index.vue +++ b/src/components/Device/components/MoreDropdown/components/Record/index.vue @@ -8,8 +8,8 @@ import { openFloatControl } from '$/utils/device/index.js' const recordModel = { default: { - excludes: '', - command: '', + excludes: [], + commands: [], extname: config => config['--record-format'] || 'mp4', }, audio: { @@ -64,17 +64,21 @@ export default { isRecord: ['default', 'audio'].includes(this.recordType), isCamera: ['camera'].includes(this.recordType), excludes: [ - '--otg', - '--mouse=aoa', - '--keyboard=aoa', - '--show-touches', - ...this.activeModel.excludes, + ...new Set([ + '--otg', + '--mouse=aoa', + '--keyboard=aoa', + '--show-touches', + ...this.activeModel.excludes, + ]), ], }) - args += ` ${this.activeModel.commands.join(' ')}` + const commands = this.activeModel.commands || [] - console.log('args', args) + if (commands.length) { + args += ` ${commands.join(' ')}` + } try { const recording = this.$scrcpy.record(row.id, {