mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
limit max number of logs page
This commit is contained in:
parent
c420f0397c
commit
927b438a4b
@ -33,6 +33,9 @@ const Logs: React.FC = () => {
|
||||
window.electron.ipcRenderer.on('mihomoLogs', (_e, log: IMihomoLogInfo) => {
|
||||
log.time = new Date().toLocaleString()
|
||||
setLogs((prevLogs) => {
|
||||
if (prevLogs.length >= 500) {
|
||||
prevLogs.shift()
|
||||
}
|
||||
return [...prevLogs, log]
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user