mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +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…
Reference in New Issue
Block a user