Skip to content

Commit 53a4b63

Browse files
committed
When opening a submitted self service work from the My work page, it is opening empty form
1 parent 6d106fe commit 53a4b63

File tree

5 files changed

+2
-16
lines changed

5 files changed

+2
-16
lines changed

src/apps/self-service/src/actions/autoSave.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ export const triggerCookieClear = () => ({
2121
type: ACTIONS.AUTO_SAVE.TRIGGER_COOKIE_CLEARED,
2222
});
2323

24-
export const autoSaveCookieCleared = (isCookieCleared) => ({
25-
type: ACTIONS.AUTO_SAVE.COOKIE_CLEARED,
26-
payload: isCookieCleared,
27-
});
28-
2924
export const sendAutoSavedPatch = (dataToSave, challengeId) => (dispatch) => {
3025
patchChallenge(dataToSave, challengeId)
3126
.then((patched) => {

src/apps/self-service/src/config/constants/work.constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export const ACTIONS = {
9797
SET_ITEM: "SET_ITEM",
9898
},
9999
AUTO_SAVE: {
100-
COOKIE_CLEARED: "COOKIE_CLEARED",
101100
TRIGGER_AUTO_SAVE: "TRIGGER_AUTO_SAVE",
102101
INIT_ERRORED: "INIT_ERRORED",
103102
TRIGGER_COOKIE_CLEARED: "TRIGGER_COOKIE_CLEARED",

src/apps/self-service/src/containers/products/review/Review.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ const Review = ({
167167
)
168168
.then((res) => {
169169
activateChallenge(challengeId);
170+
clearPreviousForm();
170171
navigate(nextPageUrl || `${selfServiceRootRoute}/thank-you`);
171172
setProgressItem(8);
172173
setPaymentFailed(false);
173-
clearPreviousForm();
174174
})
175175
.catch(() => {
176176
setPaymentFailed(true);

src/apps/self-service/src/reducers/autoSave.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ACTIONS } from "../config";
66

77
const initialState = {
88
triggered: false,
9-
cookieCleared: false,
109
initErrored: null,
1110
forced: false,
1211
};
@@ -20,11 +19,6 @@ const autoSaveReducer = (state = initialState, action) => {
2019
forced: action.payload.isForced,
2120
isLoggedIn: action.payload.isLoggedIn,
2221
};
23-
case ACTIONS.AUTO_SAVE.COOKIE_CLEARED:
24-
return {
25-
...state,
26-
cookieCleared: action.payload,
27-
};
2822
case ACTIONS.AUTO_SAVE.INIT_ERRORED:
2923
return {
3024
...state,

src/apps/self-service/src/utils/autoSaveBeforeLogin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import "moment-timezone";
66
import { EnvironmentConfig } from "~/config";
77

88
import {
9-
autoSaveCookieCleared,
109
sendAutoSavedPatch,
1110
storeAutoSavedCookie,
1211
} from "../actions/autoSave";
@@ -54,11 +53,10 @@ export const saveUpdatesMiddleware = ({ dispatch, getState }) => {
5453

5554
const clearCache = () => {
5655
clearAutoSavedForm();
57-
dispatch(autoSaveCookieCleared(true));
5856
};
5957

6058
const clearCachedCookie = (autoSave) => {
61-
if (autoSave.triggered && !autoSave.cookieCleared) {
59+
if (autoSave.triggered && getCookie(AUTO_SAVE_FORM)) {
6260
clearCache();
6361
}
6462
};

0 commit comments

Comments
 (0)