Replace session with user in team accounts
This commit replaces the session object with the user object in the team accounts feature. This change is reflected in the team-account-danger-zone, layout, team-account-workspace, and billing components. The usage of the user object provides more specificity and accuracy in handling user information compared to the more generic session object.
This commit is contained in:
@@ -47,14 +47,14 @@ export function TeamAccountDangerZone({
|
||||
|
||||
primaryOwnerUserId: string;
|
||||
}>) {
|
||||
const { data: user, isLoading } = useUser();
|
||||
const { data: user } = useUser();
|
||||
|
||||
if (isLoading) {
|
||||
if (!user) {
|
||||
return <LoadingOverlay fullPage={false} />;
|
||||
}
|
||||
|
||||
// Only the primary owner can delete the team account
|
||||
const userIsPrimaryOwner = user?.id === primaryOwnerUserId;
|
||||
const userIsPrimaryOwner = user.id === primaryOwnerUserId;
|
||||
|
||||
if (userIsPrimaryOwner) {
|
||||
return <DeleteTeamContainer account={account} />;
|
||||
|
||||
Reference in New Issue
Block a user