Enclose in try..finally
Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
parent
7e8c0109ae
commit
a8a04d4036
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Reference in a new issue