diff --git a/assets/js/src/segments/dynamic/form.tsx b/assets/js/src/segments/dynamic/form.tsx index c80b9adcae..e716f29504 100644 --- a/assets/js/src/segments/dynamic/form.tsx +++ b/assets/js/src/segments/dynamic/form.tsx @@ -134,7 +134,14 @@ export const Form: React.FunctionComponent = ({
-
diff --git a/assets/js/src/segments/dynamic/store/actions.ts b/assets/js/src/segments/dynamic/store/actions.ts index 1791e80db8..27b58a28d4 100644 --- a/assets/js/src/segments/dynamic/store/actions.ts +++ b/assets/js/src/segments/dynamic/store/actions.ts @@ -56,7 +56,7 @@ export function* pageLoaded(segmentId?: number): Generator<{ segmentId, })); if (!success || res.is_plugin_missing) { - window.location.href = '#/segments'; + window.location.href = 'admin.php?page=mailpoet-segments#/segments'; } yield setSegment(res); MailPoet.Modal.loading(false); @@ -90,7 +90,7 @@ export function* handleSave(segmentId?: number): Generator<{ })); if (success) { - window.location.href = '#/segments'; + window.location.href = 'admin.php?page=mailpoet-segments#/segments'; if (segmentId !== undefined) { messages.onUpdate(); diff --git a/assets/js/src/segments/dynamic/store/store.ts b/assets/js/src/segments/dynamic/store/store.ts index 7bf5f2bb71..a3183cb48f 100644 --- a/assets/js/src/segments/dynamic/store/store.ts +++ b/assets/js/src/segments/dynamic/store/store.ts @@ -11,6 +11,7 @@ import * as controls from './controls'; import { StateType, SegmentFormDataWindow, + SegmentTypes, } from '../types'; declare let window: SegmentFormDataWindow; @@ -27,7 +28,9 @@ export const createStore = (): void => { wooCurrencySymbol: window.mailpoet_woocommerce_currency_symbol, wooCountries: window.mailpoet_woocommerce_countries, customFieldsList: window.mailpoet_custom_fields, - segment: {}, + segment: { + segmentType: SegmentTypes.WordPressRole, + }, errors: [], };