Skip to content

Commit

Permalink
Removing dummy data when true data arrives
Browse files Browse the repository at this point in the history
  • Loading branch information
aunshx committed Sep 16, 2024
1 parent 4ab0054 commit 8d90957
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Context/visualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const VizDataHistoryProvider = ({ children }) => {
let port = parseInt(18501) + replicaPort;
const response = await fetch("http://localhost:" + String(port) + "/consensus_data");
const newData = await response.json();
if(newData) setMessageHistory({});
Object.keys(newData).map((key) => {
if (!keyList.current[replicaPort].includes(key)) {
keyList.current[replicaPort].push(key);
Expand Down Expand Up @@ -155,7 +156,7 @@ export const VizDataHistoryProvider = ({ children }) => {
};

updateStatus();
const interval = setInterval(updateStatus, 20000);
const interval = setInterval(updateStatus, 3000);

return () => clearInterval(interval);
}, []);
Expand Down

0 comments on commit 8d90957

Please sign in to comment.