Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: order recently impersonated users in descending order on the SQL (#43447)

Gildas Garcia9cf580008287
diff --git a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
index ec707ca748e..a0f859553ee 100644
--- a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
+++ b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
@@ -96,10 +96,10 @@ const UserImpersonationSelector = () => {
setPreviousSearches((prev) => {
// Remove if already present
const filtered = prev.filter((u) => u.id !== user.id)
- // Add new user to the end
- const updated = [...filtered, user]
+ // Add new user to the start of the list (last used first)
+ const updated = [user, ...filtered]
// Keep only the last 6
- return updated.slice(-6)
+ return updated.slice(0, 5)
})
if (customAccessTokenHookDetails?.type === 'https') {