mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2026-06-08 10:53:07 +08:00
fix: 🐛 Fixed the issue where there is a chance of an error when closing the floating control bar on macOS
This commit is contained in:
@@ -64,7 +64,6 @@ import { i18n } from '$/locales/index.js'
|
||||
import localeModel from '$/plugins/element-plus/locale.js'
|
||||
|
||||
const deviceStore = useDeviceStore()
|
||||
const themeStore = useThemeStore()
|
||||
|
||||
const locale = computed(() => {
|
||||
const i18nLocale = i18n.global.locale.value
|
||||
@@ -76,12 +75,10 @@ const locale = computed(() => {
|
||||
|
||||
const deviceInfo = ref({})
|
||||
|
||||
const deviceList = ref([])
|
||||
|
||||
const deviceName = computed(() => deviceStore.getLabel(deviceInfo.value, ({ deviceName }) => deviceName))
|
||||
|
||||
function handleClose() {
|
||||
window.electron.ipcRenderer.send('hide-active-window')
|
||||
window.electron.ipcRenderer.invoke('hide-control-window')
|
||||
}
|
||||
|
||||
async function switchDevice(e) {
|
||||
|
||||
@@ -29,4 +29,8 @@ export default (mainWindow) => {
|
||||
onControlMounted(controlWindow)
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.handle('hide-control-window', () => {
|
||||
controlWindow.hide()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,11 +9,17 @@ export default () => {
|
||||
|
||||
ipcMain.on('close-active-window', (event) => {
|
||||
const win = BrowserWindow.getFocusedWindow()
|
||||
win.close()
|
||||
|
||||
if (win) {
|
||||
win.close()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('hide-active-window', (event) => {
|
||||
const win = BrowserWindow.getFocusedWindow()
|
||||
win.hide()
|
||||
|
||||
if (win) {
|
||||
win.hide()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user