Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Niloofar/Fix signup redirection #17282

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { Button } from '@deriv/components';
import { redirectToSignUp, mobileOSDetectAsync, isSafari } from '@deriv/shared';
import { redirectToSignUp, mobileOSDetectAsync, isSafari, getPlatformFromUrl } from '@deriv/shared';
import { localize } from '@deriv/translations';
import { useGrowthbookGetFeatureValue } from '@deriv/hooks';

Expand All @@ -19,14 +19,9 @@ const SignupButton = ({ className }) => {
}, [isGBLoaded, trigger_os_signup]);

const handleOutSystemsRedirection = () => {
switch (process.env.NODE_ENV) {
case 'production':
return 'https://hub.deriv.com/tradershub/signup';
case 'staging':
return 'https://staging-hub.deriv.com/tradershub/signup';
default:
return 'https://dev-hub.deriv.com/tradershub/signup';
}
if (getPlatformFromUrl().is_staging_deriv_app) return 'https://staging-hub.deriv.com/tradershub/signup';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happen with NODE_ENV check?, is it not reliable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No @amam-deriv it's not working properly so I decided to replace it with the safer one 😁

if (getPlatformFromUrl().is_deriv_app) return 'https://hub.deriv.com/tradershub/signup';
return 'https://dev-hub.deriv.com/tradershub/signup';
};

const handleSignup = async () => {
Expand Down
Loading