Skip to content

Commit 9ad0693

Browse files
authored
Store edit session before prompting to select edit session destination (microsoft#164780)
1 parent 1316bf7 commit 9ad0693

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,22 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
292292

293293
const shouldStoreEditSession = await that.shouldContinueOnWithEditSession();
294294

295-
let uri = workspaceUri ?? await that.pickContinueEditSessionDestination();
296-
if (uri === undefined) { return; }
297-
298295
// Run the store action to get back a ref
299296
let ref: string | undefined;
300297
if (shouldStoreEditSession) {
301298
ref = await that.storeEditSession(false);
302299
}
303300

301+
let uri = workspaceUri ?? await that.pickContinueEditSessionDestination();
302+
if (uri === undefined) {
303+
// If the user didn't end up picking a Continue On destination
304+
// and we stored an edit session, clean up the stored edit session
305+
if (ref !== undefined) {
306+
void that.editSessionsStorageService.delete(ref);
307+
}
308+
return;
309+
}
310+
304311
// Append the ref to the URI
305312
if (ref !== undefined && uri !== 'noDestinationUri') {
306313
const encodedRef = encodeURIComponent(ref);

0 commit comments

Comments
 (0)