Skip to content

Commit

Permalink
Hosting Features: Support redirect_to param for activation (#95160)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrullon95 authored Oct 4, 2024
1 parent 740172f commit aae77f5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const HostingFeatures = () => {
const dispatch = useDispatch();
const { searchParams } = new URL( document.location.toString() );
const showActivationModal = searchParams.get( 'activate' ) !== null;
const redirectToParam = searchParams.get( 'redirect_to' );
const [ showEligibility, setShowEligibility ] = useState( showActivationModal );
const siteId = useSelector( getSelectedSiteId );
const { siteSlug, isSiteAtomic, hasSftpFeature, isPlanExpired } = useSelector( ( state ) => ( {
Expand Down Expand Up @@ -137,7 +138,9 @@ const HostingFeatures = () => {
dispatch( recordTracksEvent( 'calypso_hosting_features_activate_confirm' ) );
const params = new URLSearchParams( {
siteId: String( siteId ),
redirect_to: addQueryArgs( redirectUrl, { hosting_features: 'activated' } ),
redirect_to: addQueryArgs( redirectToParam ?? redirectUrl, {
hosting_features: 'activated',
} ),
feature: FEATURE_SFTP,
initiate_transfer_context: 'hosting',
initiate_transfer_geo_affinity: options.geo_affinity || '',
Expand Down

0 comments on commit aae77f5

Please sign in to comment.