This commit is contained in:
@@ -4,7 +4,7 @@ import { Button } from './ui/button';
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
||||||
import { Input } from './ui/input';
|
import { Input } from './ui/input';
|
||||||
import { Label } from './ui/label';
|
import { Label } from './ui/label';
|
||||||
import { useSession, signOut, updateUser } from '../lib/auth-client';
|
import { authClient, useSession, signOut, updateUser } from '../lib/auth-client';
|
||||||
import { validatePhoneOrEmail } from '../lib/validators';
|
import { validatePhoneOrEmail } from '../lib/validators';
|
||||||
|
|
||||||
export function ProfileSettings() {
|
export function ProfileSettings() {
|
||||||
@@ -59,6 +59,7 @@ export function ProfileSettings() {
|
|||||||
const data = await res.json().catch(() => ({}));
|
const data = await res.json().catch(() => ({}));
|
||||||
setNameError(data.error || 'Failed to save name.');
|
setNameError(data.error || 'Failed to save name.');
|
||||||
} else {
|
} else {
|
||||||
|
await authClient.getSession({ fetchOptions: { cache: 'no-store' } });
|
||||||
setNameSaved(true);
|
setNameSaved(true);
|
||||||
setTimeout(() => setNameSaved(false), 3000);
|
setTimeout(() => setNameSaved(false), 3000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user