fix: 🐛 Repair floating action bar start application error

This commit is contained in:
viarotel 2024-11-06 19:12:33 +08:00
parent b2bb0aeb72
commit 487e7e2ec4
3 changed files with 8 additions and 4 deletions

View File

@ -10,7 +10,7 @@ export default function (controlWindow) {
return { return {
label: item.label, label: item.label,
click() { click() {
controlWindow.webContents.send(channel, item.value) controlWindow.webContents.send(channel, item.value, item)
}, },
} }
}) })

View File

@ -25,6 +25,9 @@
</template> </template>
<script> <script>
import { openFloatControl } from '$/utils/device/index.js'
import { toRaw } from 'vue'
export default { export default {
props: { props: {
device: { device: {
@ -80,8 +83,8 @@ export default {
window.electron.ipcRenderer.once( window.electron.ipcRenderer.once(
channel, channel,
(event, data) => { (event, value, item) => {
this.handleCommand(data) this.handleCommand(item)
}, },
) )
@ -103,6 +106,8 @@ export default {
await window.scrcpy.startApp(this.device.id, { title, commands, packageName: value }) await window.scrcpy.startApp(this.device.id, { title, commands, packageName: value })
openFloatControl(toRaw(this.device))
this.loading = false this.loading = false
}, },
}, },

View File

@ -72,7 +72,6 @@ export default {
window.electron.ipcRenderer.once( window.electron.ipcRenderer.once(
channel, channel,
(event, data) => { (event, data) => {
console.log('data')
this.handleCommand(data) this.handleCommand(data)
}, },
) )