fix 1 #3
File diff suppressed because one or more lines are too long
|
|
@ -59,17 +59,16 @@ export class ContentService {
|
|||
}
|
||||
|
||||
private _clickToConversation(id: string) {
|
||||
// New Teams DOM: find via title element → closest treeitem
|
||||
const titleEl = document.getElementById(`title-chat-list-item_${id}`);
|
||||
const el =
|
||||
titleEl?.closest<HTMLElement>('[data-testid="list-item"]') ??
|
||||
document.getElementById(`chat-list-item_${id}`);
|
||||
|
||||
if (el) {
|
||||
this.service.lastClickedRoomId = id;
|
||||
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
setTimeout(() => el.click(), 200);
|
||||
}
|
||||
return el?.click();
|
||||
}
|
||||
|
||||
private async _waitForMessagesToAppear(
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export class TeamsChatService {
|
|||
// private readonly MY_NAME = "Apactech com";
|
||||
public lastMessage?: IMessage;
|
||||
public initialHistories: IMessage[] = [];
|
||||
public lastClickedRoomId?: string;
|
||||
|
||||
public elTags = {
|
||||
container_scroll: '//*[@data-testid="simple-collab-rail"]',
|
||||
|
|
@ -58,6 +59,11 @@ export class TeamsChatService {
|
|||
?.id?.replace("chat-list-item_", "");
|
||||
}
|
||||
|
||||
// Fallback: tracked from programmatic click
|
||||
if (!roomId) {
|
||||
roomId = this.lastClickedRoomId;
|
||||
}
|
||||
|
||||
const roomName = (
|
||||
document.querySelector(this.elTags.room_name) as HTMLElement
|
||||
)?.innerText;
|
||||
|
|
|
|||
Loading…
Reference in New Issue