From 991da1405f46f08bd096c12d17886053aa580cbc Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Tue, 28 Mar 2023 14:24:23 -0400 Subject: [PATCH] Updates disabled buttons in focus view rows --- .../apps/plus/focus/components/pull-request-row.ts | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/webviews/apps/plus/focus/components/pull-request-row.ts b/src/webviews/apps/plus/focus/components/pull-request-row.ts index c2c9fd0..aac3c88 100644 --- a/src/webviews/apps/plus/focus/components/pull-request-row.ts +++ b/src/webviews/apps/plus/focus/components/pull-request-row.ts @@ -103,15 +103,15 @@ const template = html` @@ -213,7 +213,6 @@ const styles = css` .actions a[tabindex='-1'] { opacity: 0.5; cursor: default; - pointer-events: none; } .actions a code-icon { @@ -358,11 +357,21 @@ export class PullRequestRow extends FASTElement { return assignees; } - onOpenWorktreeClick(_e: Event) { + onOpenWorktreeClick(e: Event) { + if (this.iscurrentWorktree) { + e.preventDefault(); + e.stopImmediatePropagation(); + return; + } this.$emit('open-worktree', this.pullRequest!); } - onSwitchBranchClick(_e: Event) { + onSwitchBranchClick(e: Event) { + if (this.isCurrentBranch) { + e.preventDefault(); + e.stopImmediatePropagation(); + return; + } this.$emit('switch-branch', this.pullRequest!); } }