Log conversation open time
This commit is contained in:
parent
f1586578ff
commit
26421b8c18
6 changed files with 72 additions and 15 deletions
|
@ -119,6 +119,8 @@ export class ConversationController {
|
|||
|
||||
private _initialPromise: undefined | Promise<void>;
|
||||
|
||||
private _conversationOpenStart = new Map<string, number>();
|
||||
|
||||
constructor(private _conversations: ConversationModelCollectionType) {}
|
||||
|
||||
get(id?: string | null): ConversationModel | undefined {
|
||||
|
@ -754,6 +756,20 @@ export class ConversationController {
|
|||
return this._initialPromise;
|
||||
}
|
||||
|
||||
onConvoOpenStart(conversationId: string): void {
|
||||
this._conversationOpenStart.set(conversationId, Date.now());
|
||||
}
|
||||
|
||||
onConvoMessageMount(conversationId: string): void {
|
||||
const loadStart = this._conversationOpenStart.get(conversationId);
|
||||
if (loadStart === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._conversationOpenStart.delete(conversationId);
|
||||
this.get(conversationId)?.onOpenComplete(loadStart);
|
||||
}
|
||||
|
||||
private async doLoad(): Promise<void> {
|
||||
log.info('ConversationController: starting initial fetch');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue