mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-14 20:02:03 +08:00
refactor(main): 重构字幕引擎启动和错误处理逻辑
- 修改了字幕引擎的启动条件,增加了对环境变量和自定义应用的检查 - 优化了错误处理机制,通过控制窗口发送错误消息 - 在前端增加了错误通知功能
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { notification } from 'ant-design-vue'
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
|
||||
import { h } from 'vue'
|
||||
|
||||
export const useCaptionControlStore = defineStore('captionControl', () => {
|
||||
const captionEngine = ref([
|
||||
@@ -109,6 +112,16 @@ export const useCaptionControlStore = defineStore('captionControl', () => {
|
||||
});
|
||||
})
|
||||
|
||||
window.electron.ipcRenderer.on('control.error.send', (_, message) => {
|
||||
notification.open({
|
||||
message: '发生错误',
|
||||
description: message,
|
||||
duration: null,
|
||||
placement: 'topLeft',
|
||||
icon: () => h(ExclamationCircleOutlined, { style: 'color: #ff4d4f' })
|
||||
});
|
||||
})
|
||||
|
||||
return {
|
||||
captionEngine, // 字幕引擎
|
||||
audioType, // 音频类型
|
||||
|
||||
Reference in New Issue
Block a user