From ab70e7921c6dc22a53d683fb53c7eebb8a1c6dfd Mon Sep 17 00:00:00 2001 From: Miggy Eusebio Date: Thu, 21 Sep 2023 17:58:24 -0700 Subject: [PATCH] add delay to updating pr page --- src/hosts/azureDevops.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hosts/azureDevops.ts b/src/hosts/azureDevops.ts index 389eb87..a23d18b 100644 --- a/src/hosts/azureDevops.ts +++ b/src/hosts/azureDevops.ts @@ -23,9 +23,14 @@ export function injectionScope(url: string) { this.insertHTML(insertions); chrome.runtime.onMessage.addListener(request => { if (request.message === 'onHistoryStateUpdated') { - const newUri = new URL(request.details.url); - const newInsertions = this.getInsertions(newUri.pathname, newUri.searchParams); - this.insertHTML(newInsertions); + setTimeout( + () => { + const newUri = new URL(request.details.url); + const newInsertions = this.getInsertions(newUri.pathname, newUri.searchParams); + this.insertHTML(newInsertions); + }, + request.details.url.includes('pullrequest') ? 300 : 0, + ); } }); }