File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 985985 }
986986
987987 async function annotateWorkItemWithFollowerList ( commentEditor ) {
988- document . querySelectorAll ( '.work-item-followers-list' ) . forEach ( e => e . remove ( ) ) ;
988+ const commentEditorContainer = commentEditor . closest ( '.new-comment-div' ) ;
989+ commentEditorContainer . querySelectorAll ( '.work-item-followers-list' ) . forEach ( e => e . remove ( ) ) ;
989990
990- const workItemId = getCurrentWorkItemId ( ) ;
991+ const workItemId = getCurrentWorkItemId ( commentEditor ) ;
991992 const queryResponse = await fetch ( `${ azdoApiBaseUrl } _apis/notification/subscriptionquery?api-version=6.0` , {
992993 method : 'POST' ,
993994 headers : {
10171018 }
10181019 }
10191020
1020- function getCurrentWorkItemId ( ) {
1021+ function getCurrentWorkItemId ( commentEditor ) {
10211022 // Try getting the link from the work item header, in case this is opened in preview view
1022- const header = document . querySelector ( '.work-item-form-header' ) ;
1023+ const workItemPage = commentEditor . closest ( '.work-item-form-page' ) ;
1024+ const header = workItemPage . querySelector ( '.work-item-form-header' ) ;
10231025 const links = header . querySelectorAll ( 'a' ) ;
10241026 // Loop through the links and check if their target matches a link for a work item
10251027 const workItemLink = Array . from ( links ) . find ( link => link . href . includes ( '_workitems' ) ) ;
You can’t perform that action at this time.
0 commit comments