From a24ddad48c9aed65d837aacf8479ae7f5bd2356b Mon Sep 17 00:00:00 2001 From: Yakov <16872793+yakov116@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:03:47 -0400 Subject: [PATCH] Only run fast-reviews once --- source/features/faster-reviews.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/features/faster-reviews.tsx b/source/features/faster-reviews.tsx index a8eccbed01e..dae9533e7b5 100644 --- a/source/features/faster-reviews.tsx +++ b/source/features/faster-reviews.tsx @@ -7,12 +7,16 @@ import * as pageDetect from 'github-url-detection'; import features from '.'; import onReplacedElement from '../helpers/on-replaced-element'; -async function addSidebarReviewButton(): Promise { +async function addSidebarReviewButton(): Promise { const reviewFormUrl = new URL(location.href); reviewFormUrl.pathname += '/files'; reviewFormUrl.hash = 'submit-review'; const sidebarReviewsSection = await elementReady('[aria-label="Select reviewers"] .discussion-sidebar-heading'); + if (select.exists('[data-hotkey="v"]', sidebarReviewsSection)) { + return false; + } + sidebarReviewsSection!.append( review now