Skip to content

Commit 335f6e7

Browse files
committed
Fixes broken Home commands
1 parent 0db60ee commit 335f6e7

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/webviews/apps/plus/home/components/active-work.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export class GlActiveBranchCard extends GlBranchCardBase {
327327
actions.push(
328328
html`<menu-item
329329
?disabled=${isFetching}
330-
href=${this._webview.createCommandLink('gitlens.ai.explainWip:')}
330+
href=${this.createWebviewCommandLinkWithBranchRef('gitlens.ai.explainWip:')}
331331
>Explain Working Changes (Preview)</menu-item
332332
>`,
333333
);
@@ -336,7 +336,7 @@ export class GlActiveBranchCard extends GlBranchCardBase {
336336
actions.push(
337337
html`<menu-item
338338
?disabled=${isFetching}
339-
href=${this._webview.createCommandLink('gitlens.ai.explainBranch:')}
339+
href=${this.createWebviewCommandLinkWithBranchRef('gitlens.ai.explainBranch:')}
340340
>Explain Branch Changes (Preview)</menu-item
341341
>`,
342342
);
@@ -346,7 +346,7 @@ export class GlActiveBranchCard extends GlBranchCardBase {
346346
actions.push(
347347
html`<menu-item
348348
?disabled=${isFetching}
349-
href=${this._webview.createCommandLink('gitlens.createCloudPatch:')}
349+
href=${this.createWebviewCommandLinkWithBranchRef('gitlens.createCloudPatch:')}
350350
>Share as Cloud Patch</menu-item
351351
>`,
352352
);
@@ -356,7 +356,7 @@ export class GlActiveBranchCard extends GlBranchCardBase {
356356
<gl-button
357357
aria-busy=${ifDefined(isFetching)}
358358
?disabled=${isFetching}
359-
href=${this._webview.createCommandLink('gitlens.createCloudPatch:')}
359+
href=${this.createWebviewCommandLinkWithBranchRef('gitlens.createCloudPatch:')}
360360
appearance="secondary"
361361
tooltip="Share as Cloud Patch"
362362
><code-icon icon="gl-cloud-patch-share"></code-icon>
@@ -401,7 +401,7 @@ export class GlActiveBranchCard extends GlBranchCardBase {
401401
<gl-button
402402
aria-busy=${ifDefined(isFetching)}
403403
?disabled=${isFetching}
404-
href=${this._webview.createCommandLink('gitlens.composeCommits:home')}
404+
href=${this.createWebviewCommandLinkWithBranchRef('gitlens.composeCommits:')}
405405
appearance="secondary"
406406
density="compact"
407407
><code-icon icon="wand" slot="prefix"></code-icon>Compose Commits...<span slot="tooltip"

src/webviews/home/homeWebview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
376376
const [arg] = args;
377377
if (isWebviewContext(arg)) {
378378
const { webview: _webview, webviewInstance: _webviewInstance, ...rest } = arg;
379-
args.splice(0, 1, hasKeys(rest) ? rest : undefined);
379+
if (hasKeys(rest)) {
380+
args.splice(0, 1, rest);
381+
} else {
382+
args.length = 0;
383+
}
380384
}
381385

382386
// eslint-disable-next-line @typescript-eslint/no-unsafe-return

0 commit comments

Comments
 (0)