mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
limit max number of logs page
This commit is contained in:
parent
7ed9af3dd6
commit
21bf35bd06
|
@ -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…
Reference in New Issue
Block a user