diff --git a/backend/src/Designer/Controllers/PreviewController.cs b/backend/src/Designer/Controllers/PreviewController.cs index a230fae5036..785c021916f 100644 --- a/backend/src/Designer/Controllers/PreviewController.cs +++ b/backend/src/Designer/Controllers/PreviewController.cs @@ -859,7 +859,7 @@ public IActionResult UpdateAttachmentWithTag(string org, string app, [FromQuery] private string GetSelectedLayoutSetInEditorFromRefererHeader(string refererHeader) { Uri refererUri = new(refererHeader); - string layoutSetName = HttpUtility.ParseQueryString(refererUri.Query)["selectedLayoutSetInEditor"]; + string layoutSetName = HttpUtility.ParseQueryString(refererUri.Query)["selectedLayoutSet"]; return string.IsNullOrEmpty(layoutSetName) ? null : layoutSetName; } diff --git a/frontend/app-preview/src/views/LandingPage.tsx b/frontend/app-preview/src/views/LandingPage.tsx index bdd4160b642..3fc33ce8c51 100644 --- a/frontend/app-preview/src/views/LandingPage.tsx +++ b/frontend/app-preview/src/views/LandingPage.tsx @@ -32,9 +32,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { const { data: instanceId } = useInstanceIdQuery(org, app); const repoType = getRepositoryType(org, app); const menu = getTopBarAppPreviewMenu(org, app, repoType, t); - const [selectedLayoutSetInEditor, setSelectedLayoutSetInEditor] = useLocalStorage( - 'layoutSet/' + app, - ); + const [selectedLayoutSet, setSelectedLayoutSet] = useLocalStorage('layoutSet/' + app, null); const [previewViewSize, setPreviewViewSize] = useLocalStorage( 'viewSize', 'desktop', @@ -43,7 +41,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { input !== null && input.tagName === 'IFRAME'; const handleChangeLayoutSet = (layoutSet: string) => { - setSelectedLayoutSetInEditor(layoutSet); + setSelectedLayoutSet(layoutSet); // might need to remove selected layout from local storage to make sure first page is selected window.location.reload(); }; @@ -79,7 +77,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { } @@ -89,7 +87,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => {