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
|
<ErrorBoundary
|
||||||
FallbackComponent={ErrorRenderer}
|
FallbackComponent={ErrorRenderer}
|
||||||
onReset={window.location.reload}
|
onReset={() => window.location.reload()}
|
||||||
>
|
>
|
||||||
<Switch>
|
<Switch>
|
||||||
{routes(() => {}).map((route, i) => (
|
{routes(() => {}).map((route, i) => (
|
||||||
|
|
|
@ -33,11 +33,12 @@ export const SessionsSection = () => {
|
||||||
)
|
)
|
||||||
).flat();
|
).flat();
|
||||||
|
|
||||||
|
const userIds = Array.from(
|
||||||
|
new Set(clientSessions.map((session) => session.userId))
|
||||||
|
);
|
||||||
const userSessions = (
|
const userSessions = (
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
clientSessions.map((session) =>
|
userIds.map((userId) => adminClient.users.listSessions({ id: userId! }))
|
||||||
adminClient.users.listSessions({ id: session.userId! })
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
).flat();
|
).flat();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue