Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store edit session before prompting to select edit session destination #164780

Merged
merged 1 commit into from Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -292,15 +292,22 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo

const shouldStoreEditSession = await that.shouldContinueOnWithEditSession();

let uri = workspaceUri ?? await that.pickContinueEditSessionDestination();
if (uri === undefined) { return; }

// Run the store action to get back a ref
let ref: string | undefined;
if (shouldStoreEditSession) {
ref = await that.storeEditSession(false);
}

let uri = workspaceUri ?? await that.pickContinueEditSessionDestination();
if (uri === undefined) {
// If the user didn't end up picking a Continue On destination
// and we stored an edit session, clean up the stored edit session
if (ref !== undefined) {
void that.editSessionsStorageService.delete(ref);
}
return;
}

// Append the ref to the URI
if (ref !== undefined && uri !== 'noDestinationUri') {
const encodedRef = encodeURIComponent(ref);
Expand Down