Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion webviews/common/createContextNew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,15 @@ export class CreatePRContextNew {
try {
this.updateState({ creating: false });
const args: CreatePullRequestNew = this.copyParams();
vscode.setState(defaultCreateParams);
await this.postMessage({
command: 'pr.create',
args,
});
// Only clear persisted state after the create succeeds. Resetting before
// awaiting would discard the user's title/description if the create fails
// (for example when the branch push fails and needs `--force`), causing
// the description to fall back to the template on the next webview load.
vscode.setState(defaultCreateParams);
} catch (e) {
this.updateState({ createError: (typeof e === 'string') ? e : (e.message ? e.message : 'An unknown error occurred.') });
}
Expand Down
Loading