handle other error on user screen

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-03-01 12:35:17 +03:00
parent cfa2261cd5
commit 0574d4e8d0

View File

@ -26,13 +26,15 @@ export const UserPage = () => {
{acc.isLoading && <h1>Отправляем запрос</h1>} {acc.isLoading && <h1>Отправляем запрос</h1>}
{acc.isSuccess && <h1>Успешно</h1>} {acc.isSuccess && <h1>Успешно</h1>}
{acc.error && {acc.error && (
(acc as any).error?.data?.body?.errorMessage ===
'Code is expired' && (
<div style={{ padding: 12, marginTop: 24, fontSize: 36 }}> <div style={{ padding: 12, marginTop: 24, fontSize: 36 }}>
<ErrorSpan> <ErrorSpan>
Не удалось активировать код доступа. Попробуйте отсканировать {(acc as any).error?.data?.body?.errorMessage ===
код еще раз 'Code is expired' ? (
'Не удалось активировать код доступа. Попробуйте отсканировать кодеще раз'
) : (
<pre>{JSON.stringify(acc.error, null, 4)}</pre>
)}
</ErrorSpan> </ErrorSpan>
</div> </div>
)} )}