Handle network interruptions in scrollable blockchain

This commit is contained in:
Mononaut committed 2023-02-23 13:52:08 -06:00
1 parent da3446f522
commit 8eca1e5f7e
7 files changed
+32 -9

No files matched your search

+6 -1
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];
}