Merge branch 'develop' into 'main'

Develop

See merge request witapp/aura-webapp!123
This commit is contained in:
Daniil Chemerkin 2024-05-06 21:42:06 +00:00
commit b650570936
5 changed files with 19 additions and 3 deletions

View File

@ -174,6 +174,7 @@ export interface ICreateAuthorizePayload {
export interface ICreateAuthorizeResponse {
token: string;
userId?: string;
}
export const createAuthorizeRequest = (data: ICreateAuthorizePayload): Request => {

View File

@ -228,7 +228,8 @@ function App(): JSX.Element {
return dispatch(actions.status.update("lead"));
}
})();
}, [dispatch, api, token, user]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, api, token]);
useEffect(() => {
async function getApng() {

View File

@ -13,7 +13,7 @@ function PaymentSuccessPage(): JSX.Element {
const dispatch = useDispatch();
const handleNext = () => {
dispatch(actions.status.update("subscribed"));
navigate(routes.client.home());
navigate(routes.client.addReport());
};
return (

View File

@ -114,7 +114,13 @@ export const useAuthentication = () => {
try {
setIsLoading(true);
const payload = getAuthorizationPayload(email, source);
const { token } = await api.authorization(payload);
const { token, userId } = await api.authorization(payload);
if (userId?.length && !!window.ym) {
window.ym(95799066, 'userParams', {
UserID: userId
})
window.ym(95799066, 'setUserID', userId);
}
const { user } = await api.getUser({ token });
signUp(token, user);
setToken(token);

View File

@ -22,3 +22,11 @@ export interface SignupForm {
}
export type UserStatus = "lead" | "registred" | "subscribed" | "unsubscribed";
declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ym: any;
}
}