@@ -149,7 +149,10 @@ import {
149
149
selectGitApplicationCurrentBranch ,
150
150
} from "selectors/gitModSelectors" ;
151
151
import { appsmithTelemetry } from "instrumentation" ;
152
- import { getLayoutSavePayload } from "ee/sagas/helpers" ;
152
+ import {
153
+ getLayoutSavePayload ,
154
+ generateUIModuleInstanceSaga ,
155
+ } from "ee/sagas/helpers" ;
153
156
import { apiFailureResponseInterceptor } from "api/interceptors/response" ;
154
157
import type { AxiosError } from "axios" ;
155
158
import { handleFetchApplicationError } from "./ApplicationSagas" ;
@@ -271,6 +274,8 @@ export function* handleFetchedPage({
271
274
yield put ( fetchSnapshotDetailsAction ( ) ) ;
272
275
// set current page
273
276
yield put ( updateCurrentPage ( pageId , pageSlug , pagePermissions ) ) ;
277
+ // Generate UI module instances when page DSL is loaded
278
+ yield call ( generateUIModuleInstanceSaga ) ;
274
279
// dispatch fetch page success
275
280
yield put ( fetchPageSuccess ( ) ) ;
276
281
@@ -449,6 +454,11 @@ export function* fetchPublishedPageResourcesSaga(
449
454
}
450
455
451
456
yield call ( postFetchedPublishedPage , pageWithMigratedDsl , pageId ) ;
457
+ // In view mode, the fetchPublishedPageResourcesSaga is called only
458
+ // when page is switched. So, we need to generate UI module instances.
459
+ // Whereas, setupPublishedPageSaga gets called on first time app load in view mode.
460
+ // This is differently done for some reason when compared to edit mode.
461
+ yield call ( generateUIModuleInstanceSaga ) ;
452
462
453
463
// NOTE: fetchActionsForView is used here to update publishedActions in redux store and not to fetch actions again
454
464
yield put ( fetchActionsForView ( { applicationId : "" , publishedActions } ) ) ;
0 commit comments