File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
apps/desktop/src/components Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" module >
2
2
export interface CreatePrParams {
3
+ stackId: string ;
4
+ branchName: string ;
3
5
title: string ;
4
6
body: string ;
5
7
draft: boolean ;
193
195
if (! branch ) return ;
194
196
if (! $user ) return ;
195
197
198
+ // Declare early to have them inside the function closure, in case
199
+ // the component unmounts or updates.
200
+ const closureStackId = stackId ;
201
+ const closureBranchName = branchName ;
202
+ const title = prTitle .value ;
203
+ const body = shouldAddPrBody () ? prBody .value : ' ' ;
204
+ const draft = $createDraft ;
205
+
196
206
isCreatingReview = true ;
197
207
await tick ();
198
208
217
227
posthog .capture (' Butler Review Created' );
218
228
butRequestDetailsService .setDetails (reviewId , prTitle .value , prBody .value );
219
229
}
230
+
220
231
if ((canPublishPR && $createPullRequest ) || ! canPublishBR ) {
221
232
const pr = await createPr ({
222
- title: prTitle .value ,
223
- body: shouldAddPrBody () ? prBody .value : ' ' ,
224
- draft: $createDraft ,
233
+ stackId: closureStackId ,
234
+ branchName: closureBranchName ,
235
+ title ,
236
+ body ,
237
+ draft ,
225
238
upstreamBranchName
226
239
});
227
240
prNumber = pr ?.number ;
310
323
// Store the new pull request number with the branch data.
311
324
await stackService .updateBranchPrNumber ({
312
325
projectId ,
313
- stackId ,
314
- branchName ,
326
+ stackId: params . stackId ,
327
+ branchName: params . branchName ,
315
328
prNumber: pr .number
316
329
});
317
330
You can’t perform that action at this time.
0 commit comments