Enclose in try..finally

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-10-28 12:00:22 +05:30
parent 7e8c0109ae
commit a8a04d4036

View File

@ -70,8 +70,13 @@ export class TimelineViewModel extends ViewModel {
onReset: (idx, tile) => checkForUpdate(idx, tile)
};
this.tiles.subscribe(subscription);
const gapResult = await gapPromise;
this.tiles.unsubscribe(subscription);
let gapResult;
try {
gapResult = await gapPromise;
}
finally {
this.tiles.unsubscribe(subscription);
}
if (!gapResult) {
return;
}