fix: email limit and sidenav fixes

This commit is contained in:
Koosha Lahouti
2025-09-26 17:47:22 +03:30
parent b6b6918ea0
commit 7dd0673ae6
4 changed files with 46 additions and 32 deletions

View File

@@ -70,7 +70,8 @@
"phoneVerified": "Phone number verified",
"errorConfirmCode": "Failed to confirm code",
"errorChangePhone": "Failed to change phone number",
"verificationCodeSent": "Verification code sent"
"verificationCodeSent": "Verification code sent",
"onlyOneAccountAllowed": "You can only link one email account."
},
"active": {

View File

@@ -71,7 +71,8 @@
"phoneVerified": "تلفن همراه تایید شد",
"errorConfirmCode": "تایید کد با خطا مواجه شد",
"errorChangePhone": "تغییر تلفن همراه با خطا مواجه شد",
"verificationCodeSent": "کد تایید ارسال شد"
"verificationCodeSent": "کد تایید ارسال شد",
"onlyOneAccountAllowed": "شما فقط می‌توانید یک حساب ایمیل را متصل کنید"
},
"active": {

View File

@@ -107,6 +107,13 @@ export function SocialMedia() {
severity: 'success',
});
setDialogStep('enterCode');
setTimeout(
() => {
resetDialog();
},
3 * 60 * 1000,
);
}
};
@@ -128,34 +135,35 @@ export function SocialMedia() {
message: confirmData.message || t('settingForm.error'),
severity: 'error',
});
return;
}
toast({
message: confirmData.message || t('settingForm.verificationSuccessful'),
severity: 'success',
});
if (emailList.length >= 1) {
toast({
message: t('settingForm.onlyOneAccountAllowed'),
severity: 'error',
});
return;
}
const changeEmailData = await executeChangeEmail({ email: emailInput });
if (!changeEmailData) return;
if (changeEmailData.success) {
setEmailList((prev) => [
...prev,
setEmailList([
{
email: emailInput,
provider: emailInput.includes('@gmail.') ? 'google' : 'email',
time: t('settingForm.justNow'),
},
]);
toast({
message: t('settingForm.emailChangedSuccessfully'),
severity: 'success',
});
resetDialog();
resetDialog();
refetchProfile({ force: true });
}
};

View File

@@ -118,25 +118,27 @@ export function ActiveDevicesPage() {
title={t('active.activeDevices')}
subtitle={t('active.activeDevicesCaption')}
action={
<Button
size="medium"
variant="outlined"
onClick={handleTerminateAllOtherSessions}
sx={{
borderRadius: 1,
borderColor: 'error.main',
color: 'error.main',
textTransform: 'none',
flexShrink: 0,
flexGrow: 0,
width: 'auto',
}}
disabled={isLoadingProfile || isTerminating}
>
{isTerminating
? t('active.deleting')
: t('active.deleteDevicesButton')}
</Button>
<Box sx={{ display: 'flex', gap: 1 }}>
<Button
size="medium"
variant="outlined"
onClick={handleTerminateAllOtherSessions}
sx={{
borderRadius: 1,
borderColor: 'error.main',
color: 'error.main',
textTransform: 'none',
flexShrink: 0,
flexGrow: 0,
width: 'auto',
}}
disabled={isLoadingProfile || isTerminating}
>
{isTerminating
? t('active.deleting')
: t('active.deleteDevicesButton')}
</Button>
</Box>
}
>
{isLoadingProfile ? (
@@ -154,10 +156,12 @@ export function ActiveDevicesPage() {
) : (
<Box
sx={{
px: { xs: 2, sm: 3, md: 4 },
mx: { xs: 2, sm: 3, md: 4 },
py: 2,
display: 'flex',
flexDirection: 'column',
gap: 2,
bgcolor: 'background.paper',
}}
>
{devices.map((device) => (
@@ -218,7 +222,7 @@ export function ActiveDevicesPage() {
sx={{
flexBasis: { xs: '100%', sm: 'auto' },
mb: { xs: 1, sm: 0 },
minWidth: { sm: '138px' },
minWidth: { sm: '126px' },
order: { xs: 4, sm: 4 },
alignItems: 'center',
justifyContent: 'center',