Skip to content

Commit 0b7974e

Browse files
committed
instrument watch moves to row if existing listing is added
1 parent 1ec52dc commit 0b7974e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW
237237

238238
addListing(listing?: Listing) {
239239
if (listing) {
240-
this.watchesView.addListing(listing.getId())
240+
if (!this.watchesView.addListing(listing.getId())) {
241+
let node = this.gridApi?.getRowNode(listing.getId().toString())
242+
if(node) {
243+
this.gridApi?.ensureNodeVisible(node)
244+
this.gridApi?.selectNode(node)
245+
}
246+
}
241247
}
242248
}
243249

react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatchView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class InstrumentListingWatchesView implements QuoteListener {
4848
}
4949

5050

51-
addListing(listingId: number) {
51+
addListing(listingId: number) : boolean {
5252

5353

5454

@@ -63,9 +63,10 @@ export class InstrumentListingWatchesView implements QuoteListener {
6363
})
6464

6565
this.quoteSvc.SubscribeToQuote(listingId, this)
66-
66+
return true
6767
}
6868

69+
return false
6970
}
7071

7172
onQuote(quote: ClobQuote): void {

0 commit comments

Comments
 (0)