Debug history log only after clear timestamp

This commit is contained in:
muzam1l
2022-04-19 20:51:11 +05:30
parent df51d87cb2
commit aff0142870

View File

@@ -93,9 +93,8 @@ const DebugStream = () => {
pushLog(`Debug stream opened for account ${acc.value}`, {
type: "success",
});
const logs = Object.entries(body.logs)
.filter(([tm]) => +tm >= start)
const logs = Object.entries(body.logs).filter(([tm]) => +tm >= start);
logs.forEach(([tm, log]) => pushLog(log));
} catch (error) {
@@ -160,13 +159,18 @@ const DebugStream = () => {
streamState.selectedAccount = account;
}, [activeTxTab]);
const clearLog = () => {
streamState.logs = [];
streamState.statusChangeTimestamp = Date.now();
};
return (
<LogBox
enhanced
renderNav={renderNav}
title="Debug stream"
logs={logs}
clearLog={() => (streamState.logs = [])}
clearLog={clearLog}
/>
);
};