feat(desktop): report current user online clients
This commit is contained in:
@@ -144,6 +144,10 @@ function createLiveRuntimeSnapshot(controller: RuntimeControllerSnapshot) {
|
||||
channel: controller.client?.channel ?? 'dev',
|
||||
},
|
||||
] as const
|
||||
const onlineClientCount =
|
||||
typeof controller.onlineClientCount === 'number'
|
||||
? Math.max(0, controller.onlineClientCount)
|
||||
: clients.filter((item) => item.status === 'online').length
|
||||
|
||||
const accounts = controller.accounts.map((account) =>
|
||||
createRuntimeAccountView(controller, account, {
|
||||
@@ -185,7 +189,7 @@ function createLiveRuntimeSnapshot(controller: RuntimeControllerSnapshot) {
|
||||
lastFullSyncAt: controller.lastAccountsSyncAt || now,
|
||||
},
|
||||
summary: {
|
||||
onlineClients: clients.filter((item) => item.status === 'online').length,
|
||||
onlineClients: onlineClientCount,
|
||||
accountsBound: accounts.length,
|
||||
queuedTasks: tasks.filter((item) => item.status === 'queued').length,
|
||||
issuesOpen:
|
||||
|
||||
Reference in New Issue
Block a user