fix: add synced listener on eth client to flag the synced status
This commit is contained in:
parent
bb0d3f1bb2
commit
5f64664676
|
@ -189,7 +189,12 @@ async function handleStatus(aq: ActiveQuery) {
|
||||||
sendUpdate();
|
sendUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const chainSyncedListener = () => {
|
||||||
|
sendUpdate();
|
||||||
|
};
|
||||||
|
|
||||||
client.on("update", chainProgressListener);
|
client.on("update", chainProgressListener);
|
||||||
|
client.on("synced", chainSyncedListener);
|
||||||
|
|
||||||
function sendUpdate() {
|
function sendUpdate() {
|
||||||
aq.sendUpdate({
|
aq.sendUpdate({
|
||||||
|
@ -201,6 +206,7 @@ async function handleStatus(aq: ActiveQuery) {
|
||||||
|
|
||||||
aq.setReceiveUpdate?.(() => {
|
aq.setReceiveUpdate?.(() => {
|
||||||
client.off("update", chainProgressListener);
|
client.off("update", chainProgressListener);
|
||||||
|
client.off("synced", chainSyncedListener);
|
||||||
aq.respond();
|
aq.respond();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue