fix: session refresh

This commit is contained in:
David Nguyen
2025-02-19 22:29:30 +11:00
parent 63e2ef0abf
commit ec07092bf6
5 changed files with 13 additions and 208 deletions

View File

@@ -42,7 +42,7 @@ export type AvatarImageFormProps = {
};
export const AvatarImageForm = ({ className }: AvatarImageFormProps) => {
const { user } = useSession();
const { user, refreshSession } = useSession();
const { _ } = useLingui();
const { toast } = useToast();
const { revalidate } = useRevalidator();
@@ -103,13 +103,13 @@ export const AvatarImageForm = ({ className }: AvatarImageFormProps) => {
teamId: team?.id,
});
await refreshSession();
toast({
title: _(msg`Avatar Updated`),
description: _(msg`Your avatar has been updated successfully.`),
duration: 5000,
});
void revalidate();
} catch (err) {
const error = AppError.parseError(err);