feat: add navigation to forger password page, show password icon, toasts for different situations and changes of some styles

This commit is contained in:
Koosha Lahouti
2025-08-20 01:00:20 +03:30
parent 58c044542a
commit 8ed4aab666
23 changed files with 503 additions and 376 deletions

View File

@@ -49,7 +49,14 @@ export function ActiveDevicesPage() {
ip: session.ipAddress,
current: session.key === currentKey,
}));
setDevices(formattedDevices);
const sortedDevices = formattedDevices.sort((a, b) => {
if (a.current && !b.current) return -1;
if (!a.current && b.current) return 1;
return 0;
});
setDevices(sortedDevices);
}
}, [profileData, i18n.language, t]);
@@ -66,6 +73,7 @@ export function ActiveDevicesPage() {
const { data } = await deleteSessions({ keys: [id] });
if (data.success) {
setDevices((prevDevices) => prevDevices.filter((d) => d.id !== id));
showToast({ message: t('active.successDelete'), severity: 'success' });
} else {
showToast({
message: data.message || t('active.deleteFailed'),
@@ -73,7 +81,6 @@ export function ActiveDevicesPage() {
});
}
} catch (error: unknown) {
// console.error('Delete error:', error);
showToast({
message: t('active.deleteFailed'),
severity: 'error',