editors - make sure to always remove pending confirmations even in error case

This commit is contained in:
Benjamin Pasero 2021-02-02 09:38:13 +01:00
parent 4342faa67c
commit 3feb8937a8

View file

@ -1347,10 +1347,12 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
this.mapEditorToPendingConfirmation.set(editor, handleDirtyClosingPromise);
}
const veto = await handleDirtyClosingPromise;
// Make sure to remove from our map of cached pending confirmations
this.mapEditorToPendingConfirmation.delete(editor);
let veto: boolean;
try {
veto = await handleDirtyClosingPromise;
} finally {
this.mapEditorToPendingConfirmation.delete(editor);
}
// Return for the first veto we got
if (veto) {