Skip to content

Commit

Permalink
add delay to updating pr page
Browse files Browse the repository at this point in the history
  • Loading branch information
miggy-e committed Sep 22, 2023
1 parent 5accec8 commit ab70e79
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/hosts/azureDevops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
});
}
Expand Down

0 comments on commit ab70e79

Please sign in to comment.