mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-26 07:25:27 +08:00
refactor: frontend (#7097)
* refactor: remove unused window show/hide event listeners * refactor: deduplicate profile-changed event handling * refactor: remove unused setupCloseListener from use-listen * refactor: remove unused removeAllListeners from use-listen * fix(backend): dedupe profile changed notification on import * fix: avoid duplicate timer update completed event * refactor(frontend): simplify proxy switch fallback path
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
import { useListen } from '@/hooks/use-listen'
|
||||
@@ -73,20 +71,6 @@ export const useLayoutEvents = (
|
||||
),
|
||||
)
|
||||
|
||||
const appWindow = getCurrentWebviewWindow()
|
||||
register(
|
||||
(async () => {
|
||||
const [hideUnlisten, showUnlisten] = await Promise.all([
|
||||
listen('verge://hide-window', () => appWindow.hide()),
|
||||
listen('verge://show-window', () => appWindow.show()),
|
||||
])
|
||||
return () => {
|
||||
hideUnlisten()
|
||||
showUnlisten()
|
||||
}
|
||||
})(),
|
||||
)
|
||||
|
||||
return () => {
|
||||
disposed = true
|
||||
const errors: Error[] = []
|
||||
|
||||
Reference in New Issue
Block a user