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)
|
onReset: (idx, tile) => checkForUpdate(idx, tile)
|
||||||
};
|
};
|
||||||
this.tiles.subscribe(subscription);
|
this.tiles.subscribe(subscription);
|
||||||
const gapResult = await gapPromise;
|
let gapResult;
|
||||||
|
try {
|
||||||
|
gapResult = await gapPromise;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
this.tiles.unsubscribe(subscription);
|
this.tiles.unsubscribe(subscription);
|
||||||
|
}
|
||||||
if (!gapResult) {
|
if (!gapResult) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue