From e8064dc03d62ce87399bf8ac4f93aca5ff04c556 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Fri, 9 Aug 2024 00:49:38 +0530 Subject: [PATCH] fix: get all pages list for navigation --- app/client/src/pages/AppViewer/index.tsx | 4 ++-- app/client/src/selectors/editorSelectors.tsx | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/app/client/src/pages/AppViewer/index.tsx b/app/client/src/pages/AppViewer/index.tsx index fe709f39e2cd..87470d351f4c 100644 --- a/app/client/src/pages/AppViewer/index.tsx +++ b/app/client/src/pages/AppViewer/index.tsx @@ -19,7 +19,7 @@ import * as Sentry from "@sentry/react"; import { getCurrentPageDescription, getIsAutoLayout, - getViewModePageListWithHiddenPages, + getPageList, } from "selectors/editorSelectors"; import { getThemeDetails, ThemeMode } from "selectors/themeSelectors"; import { getSearchQuery } from "utils/helpers"; @@ -88,7 +88,7 @@ function AppViewer(props: Props) { const { pathname, search } = props.location; const { baseApplicationId, basePageId } = props.match.params; const isInitialized = useSelector(getIsInitialized); - const pages = useSelector(getViewModePageListWithHiddenPages); + const pages = useSelector(getPageList); const selectedTheme = useSelector(getSelectedAppTheme); const lightTheme = useSelector((state: AppState) => getThemeDetails(state, ThemeMode.LIGHT), diff --git a/app/client/src/selectors/editorSelectors.tsx b/app/client/src/selectors/editorSelectors.tsx index 5c5084aa9344..e6237748fdeb 100644 --- a/app/client/src/selectors/editorSelectors.tsx +++ b/app/client/src/selectors/editorSelectors.tsx @@ -255,25 +255,6 @@ export const getViewModePageList = createSelector( }, ); -export const getViewModePageListWithHiddenPages = createSelector( - getPageList, - getCurrentPageId, - (pageList: PageListReduxState["pages"], currentPageId?: string) => { - if (currentPageId) { - const currentPage = pageList.find( - (page) => page.pageId === currentPageId, - ); - if (!!currentPage?.isHidden) { - return [currentPage]; - } - - return pageList; - } - - return []; - }, -); - const defaultLayout: AppLayoutConfig = { type: "FLUID", };