From eeb3d6079deb1d60840d58fa78f1ab10fd77bcbb Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Wed, 2 Aug 2023 20:06:55 -0400 Subject: [PATCH] Updates PR actions bindings --- src/webviews/apps/plus/focus/components/focus-app.ts | 4 ++++ .../apps/plus/focus/components/gk-pull-request-row.ts | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/webviews/apps/plus/focus/components/focus-app.ts b/src/webviews/apps/plus/focus/components/focus-app.ts index 13fb6d8..4318f94 100644 --- a/src/webviews/apps/plus/focus/components/focus-app.ts +++ b/src/webviews/apps/plus/focus/components/focus-app.ts @@ -225,6 +225,10 @@ export class GlFocusApp extends LitElement { html``, () => html``, ), diff --git a/src/webviews/apps/plus/focus/components/gk-pull-request-row.ts b/src/webviews/apps/plus/focus/components/gk-pull-request-row.ts index b36a7fe..ebd635c 100644 --- a/src/webviews/apps/plus/focus/components/gk-pull-request-row.ts +++ b/src/webviews/apps/plus/focus/components/gk-pull-request-row.ts @@ -278,11 +278,21 @@ export class GkPullRequestRow extends LitElement { slot="trigger" href="#" tabindex="${this.hasWorktree || this.isCurrentBranch ? -1 : nothing}" - aria-label="${this.isCurrentBranch ? 'Already on this branch' : 'Switch to Branch...'}" + aria-label="${this.isCurrentBranch + ? 'Already on this branch' + : this.hasWorktree + ? 'This branch has a worktree' + : 'Switch to Branch...'}" @click="${this.onSwitchBranchClick}" > - ${this.isCurrentBranch ? 'Already on this branch' : 'Switch to Branch...'} + ${this.isCurrentBranch + ? 'Already on this branch' + : this.hasWorktree + ? 'This branch has a worktree' + : 'Switch to Branch...'} @@ -304,7 +314,7 @@ export class GkPullRequestRow extends LitElement { } onSwitchBranchClick(e: Event) { - if (this.isCurrentBranch) { + if (this.isCurrentBranch || this.hasWorktree) { e.preventDefault(); e.stopImmediatePropagation(); return;