mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-18 18:02:08 +08:00
fix(logs): preserve log data and eliminate blank flash on page navigation
Preserve SWR cache in onConnected to avoid replacing accumulated logs with kernel buffer on reconnect. Add KeepAlive for the logs page so its DOM stays mounted across route changes, removing the visible blank window when navigating back.
This commit is contained in:
@@ -101,7 +101,12 @@ export const useLogData = () => {
|
||||
async onConnected() {
|
||||
const logs = await getClashLogs()
|
||||
if (isMounted()) {
|
||||
next(null, clampLogs(filterLogsByLevel(logs, allowedTypes)))
|
||||
next(null, (current) => {
|
||||
if (!current || current.length === 0) {
|
||||
return clampLogs(filterLogsByLevel(logs, allowedTypes))
|
||||
}
|
||||
return current
|
||||
})
|
||||
}
|
||||
},
|
||||
cleanup: clearFlushTimer,
|
||||
|
||||
Reference in New Issue
Block a user