Refactor account handling to improve performance
This commit dates the transition from a global user session to individual account handling based on user ID. The transition was made across several components, notably the account settings, icons, and selector. This change improves performance by reducing unnecessary requests and ensures more accurate data handling. The commit also includes some cleanups and minor fixes spread across different components.
This commit is contained in:
@@ -19,7 +19,6 @@ export async function loadMembersPageData(
|
||||
loadTeamWorkspace(slug),
|
||||
loadAccountMembers(client, slug),
|
||||
loadInvitations(client, slug),
|
||||
loadUser(client),
|
||||
canAddMember,
|
||||
]);
|
||||
}
|
||||
@@ -38,16 +37,6 @@ async function canAddMember() {
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
async function loadUser(client: SupabaseClient<Database>) {
|
||||
const { data, error } = await client.auth.getUser();
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return data.user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load account members
|
||||
* @param client
|
||||
|
||||
Reference in New Issue
Block a user