File tree Expand file tree Collapse file tree 3 files changed +1
-33
lines changed
editors/data/redux/thunkActions Expand file tree Collapse file tree 3 files changed +1
-33
lines changed Original file line number Diff line number Diff line change @@ -213,24 +213,6 @@ export const useCourseUnit = ({ courseId, blockId }) => {
213
213
}
214
214
} , [ isMoveModalOpen ] ) ;
215
215
216
- useEffect ( ( ) => {
217
- const handlePageRefreshUsingStorage = ( event ) => {
218
- // ignoring tests for if block, because it triggers when someone
219
- // edits the component using editor which has a separate store
220
- /* istanbul ignore next */
221
- if ( event . key === 'courseRefreshTriggerOnComponentEditSave' ) {
222
- dispatch ( fetchCourseSectionVerticalData ( blockId , sequenceId ) ) ;
223
- dispatch ( fetchCourseVerticalChildrenData ( blockId , isSplitTestType ) ) ;
224
- localStorage . removeItem ( event . key ) ;
225
- }
226
- } ;
227
-
228
- window . addEventListener ( 'storage' , handlePageRefreshUsingStorage ) ;
229
- return ( ) => {
230
- window . removeEventListener ( 'storage' , handlePageRefreshUsingStorage ) ;
231
- } ;
232
- } , [ blockId , sequenceId , isSplitTestType ] ) ;
233
-
234
216
return {
235
217
sequenceId,
236
218
courseUnit,
Original file line number Diff line number Diff line change @@ -125,16 +125,6 @@ export const saveBlock = (content, returnToUnit) => (dispatch) => {
125
125
content,
126
126
onSuccess : ( response ) => {
127
127
dispatch ( actions . app . setSaveResponse ( response ) ) ;
128
- const parsedData = JSON . parse ( response . config . data ) ;
129
- if ( parsedData ?. has_changes ) {
130
- const storageKey = 'courseRefreshTriggerOnComponentEditSave' ;
131
- localStorage . setItem ( storageKey , Date . now ( ) ) ;
132
-
133
- window . dispatchEvent ( new StorageEvent ( 'storage' , {
134
- key : storageKey ,
135
- newValue : Date . now ( ) . toString ( ) ,
136
- } ) ) ;
137
- }
138
128
returnToUnit ( response . data ) ;
139
129
} ,
140
130
} ) ) ;
Original file line number Diff line number Diff line change @@ -352,11 +352,7 @@ describe('app thunkActions', () => {
352
352
} ) ;
353
353
it ( 'dispatches actions.app.setSaveResponse with response and then calls returnToUnit' , ( ) => {
354
354
dispatch . mockClear ( ) ;
355
- const mockParsedData = { has_changes : true } ;
356
- const response = {
357
- config : { data : JSON . stringify ( mockParsedData ) } ,
358
- data : { } ,
359
- } ;
355
+ const response = 'testRESPONSE' ;
360
356
calls [ 1 ] [ 0 ] . saveBlock . onSuccess ( response ) ;
361
357
expect ( dispatch ) . toHaveBeenCalledWith ( actions . app . setSaveResponse ( response ) ) ;
362
358
expect ( returnToUnit ) . toHaveBeenCalled ( ) ;
You can’t perform that action at this time.
0 commit comments