Skip to content

Commit

Permalink
✨ 添加成功启动的消息通知
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Dec 3, 2024
1 parent a94e0ee commit 458f01d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/stores/general-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ export const useGeneralSettingsStore = defineStore(

async function startAssetsServer(address: string): Promise<void> {
const [host, port] = address.split(':')
await invoke('start_assets_server', { host, port: Number.parseInt(port) }).catch((error) => {
toast.error('资源服务器错误', { description: error })
})
try {
await invoke('start_assets_server', { host, port: Number.parseInt(port) })
toast.success('资源服务器已启动', { description: `地址: ${address}` })
} catch (error) {
toast.error('资源服务器错误', { description: error as string })
}
}

watch($$(applyAcrylicWindowEffects), async (enable) => {
Expand Down

0 comments on commit 458f01d

Please sign in to comment.