Merge branch 'develop' into 'main'
Develop See merge request witapp/aura-webapp!123
This commit is contained in:
commit
b650570936
@ -174,6 +174,7 @@ export interface ICreateAuthorizePayload {
|
||||
|
||||
export interface ICreateAuthorizeResponse {
|
||||
token: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
export const createAuthorizeRequest = (data: ICreateAuthorizePayload): Request => {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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 (
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user