diff --git a/app/client/src/ce/sagas/PageSagas.tsx b/app/client/src/ce/sagas/PageSagas.tsx index 2df78275c3..28555bcaa9 100644 --- a/app/client/src/ce/sagas/PageSagas.tsx +++ b/app/client/src/ce/sagas/PageSagas.tsx @@ -149,7 +149,10 @@ import { selectGitApplicationCurrentBranch, } from "selectors/gitModSelectors"; import { appsmithTelemetry } from "instrumentation"; -import { getLayoutSavePayload } from "ee/sagas/helpers"; +import { + getLayoutSavePayload, + generateUIModuleInstanceSaga, +} from "ee/sagas/helpers"; import { apiFailureResponseInterceptor } from "api/interceptors/response"; import type { AxiosError } from "axios"; import { handleFetchApplicationError } from "./ApplicationSagas"; @@ -271,6 +274,8 @@ export function* handleFetchedPage({ yield put(fetchSnapshotDetailsAction()); // set current page yield put(updateCurrentPage(pageId, pageSlug, pagePermissions)); + // Generate UI module instances when page DSL is loaded + yield call(generateUIModuleInstanceSaga); // dispatch fetch page success yield put(fetchPageSuccess()); @@ -449,6 +454,11 @@ export function* fetchPublishedPageResourcesSaga( } yield call(postFetchedPublishedPage, pageWithMigratedDsl, pageId); + // In view mode, the fetchPublishedPageResourcesSaga is called only + // when page is switched. So, we need to generate UI module instances. + // Whereas, setupPublishedPageSaga gets called on first time app load in view mode. + // This is differently done for some reason when compared to edit mode. + yield call(generateUIModuleInstanceSaga); // NOTE: fetchActionsForView is used here to update publishedActions in redux store and not to fetch actions again yield put(fetchActionsForView({ applicationId: "", publishedActions })); diff --git a/app/client/src/ce/sagas/helpers.ts b/app/client/src/ce/sagas/helpers.ts index 555fa1d837..adebc59be9 100644 --- a/app/client/src/ce/sagas/helpers.ts +++ b/app/client/src/ce/sagas/helpers.ts @@ -110,3 +110,6 @@ export function* getLayoutSavePayload( dsl: nestedDSL, }; } + +// This is a placeholder saga and is extended in EE +export function* generateUIModuleInstanceSaga() {}