filter keep-alives
This commit is contained in:
parent
6ea9072f5b
commit
6e9842a257
1 changed files with 9 additions and 3 deletions
|
@ -18,14 +18,18 @@ export default function ActivityLog({ multiColumn }) {
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}, dummy_data);
|
// }, dummy_data);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const columnElement = useRef(null);
|
const columnElement = useRef(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const eventSource = new EventSource('/api/v1/activity_log');
|
const eventSource = new EventSource('/api/v1/activity_log');
|
||||||
eventSource.onmessage = (event) => {
|
eventSource.onmessage = (event) => {
|
||||||
dispatch(['add-log-event', JSON.parse(event.data)]);
|
const parsed = JSON.parse(event.data);
|
||||||
|
if (parsed.type !== 'keep-alive') {
|
||||||
|
dispatch(['add-log-event', parsed]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
|
@ -33,7 +37,6 @@ export default function ActivityLog({ multiColumn }) {
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const darkMode = !(document.body && document.body.classList.contains('theme-mastodon-light'));
|
const darkMode = !(document.body && document.body.classList.contains('theme-mastodon-light'));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -45,6 +48,9 @@ export default function ActivityLog({ multiColumn }) {
|
||||||
multiColumn={multiColumn}
|
multiColumn={multiColumn}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<button onClick={() => navigator.clipboard.writeText(JSON.stringify(logs, null, 2))}>Copy logs</button>
|
||||||
|
<button onClick={() => dispatch(['reset-logs'])}>Clear logs</button>
|
||||||
|
|
||||||
<div className={`${darkMode ? 'dark' : ''}`}>
|
<div className={`${darkMode ? 'dark' : ''}`}>
|
||||||
<ActivityPubVisualization logs={logs} />
|
<ActivityPubVisualization logs={logs} />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue