From defcc65848b058e1ec525962700e8eb10868458a Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 28 Jan 2025 11:29:47 +0100 Subject: [PATCH] fix(ui): co-browser (assist) list sorting - duration --- frontend/app/mstore/sessionStore.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/app/mstore/sessionStore.ts b/frontend/app/mstore/sessionStore.ts index d628edc62..ad1463801 100644 --- a/frontend/app/mstore/sessionStore.ts +++ b/frontend/app/mstore/sessionStore.ts @@ -201,11 +201,15 @@ export default class SessionStore { }); } - fetchLiveSessions = async (params = {}) => { + fetchLiveSessions = async (params: any = {}) => { runInAction(() => { this.loadingLiveSessions = true; }) try { + if (params.sort === 'duration') { // TODO ui hack to sort by duration, should be removed once the api addressed this issue + params.sort = 'timestamp'; + params.order = params.order === 'asc' ? 'desc' : 'asc'; + } const data: any = await sessionService.getLiveSessions(params); this.liveSessions = data.sessions.map((session: any) => new Session({ ...session, live: true })); this.totalLiveSessions = data.total;