nicolium: cleanup

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-06 14:39:59 +01:00
parent 28397b8a09
commit c28ddc438d

View File

@ -7,7 +7,6 @@
* @see module:@/actions/security
*/
import {
credentialAccountSchema,
PlApiClient,
type Account,
type CreateAccountParams,
@ -16,7 +15,6 @@ import {
type Token,
} from 'pl-api';
import { defineMessages } from 'react-intl';
import * as v from 'valibot';
import { createAccount } from '@/actions/accounts';
import { createApp } from '@/actions/apps';
@ -188,23 +186,9 @@ const verifyCredentials =
return account;
})
.catch((error) => {
if (error?.response?.status === 403 && error?.response?.json?.id) {
// The user is waitlisted
const account = error.response.json;
const parsedAccount = v.parse(credentialAccountSchema, error.response.json);
queryClient.setQueryData(queryKeys.accounts.show(parsedAccount.id), parsedAccount);
dispatch<VerifyCredentialsSuccessAction>({
type: VERIFY_CREDENTIALS_SUCCESS,
token,
account: parsedAccount,
});
if (account.id === getState().me) dispatch(fetchMeSuccess(parsedAccount));
return parsedAccount;
} else {
if (getState().me === null) dispatch(fetchMeFail(error));
dispatch<VerifyCredentialsFailAction>({ type: VERIFY_CREDENTIALS_FAIL, token, error });
throw error;
}
if (getState().me === null) dispatch(fetchMeFail(error));
dispatch<VerifyCredentialsFailAction>({ type: VERIFY_CREDENTIALS_FAIL, token, error });
throw error;
});
};