Browse Source

autorefresh: Ignore empty /blocks response

master
Hampus Sjöberg 4 years ago
parent
commit
54170cbc74
  1. 5
      frontend/state/index.ts

5
frontend/state/index.ts

@ -61,7 +61,10 @@ export const model: IStoreModel = {
console.log("Fetching blocks");
const result = await fetch("/blocks");
const json = (await result.json()) as IBlock[];
console.log(json);
if (json && json.length === 0) {
console.log("Got empty response from /blocks, ignoring...");
return;
}
actions.setBlocks(json);
} catch (error) {
console.log("Couldn't fetch /blocks", error.message);

Loading…
Cancel
Save