only query each client session once (#601)
this makes the ids unique so that they only get queried once
This commit is contained in:
parent
07e6628040
commit
9fc96d0afc
2 changed files with 5 additions and 4 deletions
|
@ -69,7 +69,7 @@ export const App = () => {
|
|||
>
|
||||
<ErrorBoundary
|
||||
FallbackComponent={ErrorRenderer}
|
||||
onReset={window.location.reload}
|
||||
onReset={() => window.location.reload()}
|
||||
>
|
||||
<Switch>
|
||||
{routes(() => {}).map((route, i) => (
|
||||
|
|
|
@ -33,11 +33,12 @@ export const SessionsSection = () => {
|
|||
)
|
||||
).flat();
|
||||
|
||||
const userIds = Array.from(
|
||||
new Set(clientSessions.map((session) => session.userId))
|
||||
);
|
||||
const userSessions = (
|
||||
await Promise.all(
|
||||
clientSessions.map((session) =>
|
||||
adminClient.users.listSessions({ id: session.userId! })
|
||||
)
|
||||
userIds.map((userId) => adminClient.users.listSessions({ id: userId! }))
|
||||
)
|
||||
).flat();
|
||||
|
||||
|
|
Loading…
Reference in a new issue