fix: merge style bugs

This commit is contained in:
Koosha Lahouti
2025-08-17 14:31:18 +03:30
parent dd6e2fdd0d
commit 7e5ed6e2fc
14 changed files with 254 additions and 138 deletions

View File

@@ -13,12 +13,14 @@ import { fetchProfile } from '../../api/settingsApi';
import type { LoginLog } from '../../types/settingsApiType';
import { useApi } from '@/hooks/useApi';
import { formatDate } from '@/utils/formatSessionDate';
import { useToast } from '@rkheftan/harmony-ui';
export function RecentLogins() {
const { t, i18n } = useTranslation('setting');
const [logs, setLogs] = useState<LoginLog[]>([]);
const theme = useTheme();
const isXsup = useMediaQuery(theme.breakpoints.up('xs'));
const showToast = useToast();
const {
data: profileData,
@@ -32,6 +34,14 @@ export function RecentLogins() {
}
}, [profileData]);
useEffect(() => {
if (fetchError) {
showToast({
message: getErrorMessage(fetchError) || t('active.errorFetch'),
severity: 'error',
});
}
}, [fetchError, t, showToast]);
const getErrorMessage = (error: unknown): string | null => {
if (!error) return null;
if (error instanceof Error) return error.message;