Handle network interruptions in scrollable blockchain

This commit is contained in:
Mononaut
2023-02-08 19:07:59 -06:00
parent da3446f522
commit 8eca1e5f7e
7 changed files with 32 additions and 9 deletions

View File

@@ -62,7 +62,12 @@ export class CacheService {
for (let i = 0; i < chunkSize; i++) {
this.blockLoading[maxHeight - i] = true;
}
const result = await firstValueFrom(this.apiService.getBlocks$(maxHeight));
let result;
try {
result = await firstValueFrom(this.apiService.getBlocks$(maxHeight));
} catch (e) {
console.log("failed to load blocks: ", e.message);
}
for (let i = 0; i < chunkSize; i++) {
delete this.blockLoading[maxHeight - i];
}