From 2b7d05df6b59e52fbf6a0a901e13271151ea4b1f Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 29 Feb 2024 15:38:04 -0500 Subject: [PATCH] call JS Interop in Interactive render mode, use PageState.Site.Themes rather than calling ThemeService from Control Panel --- .../Controls/Theme/ControlPanelInteractive.razor | 10 ++++++---- Oqtane.Client/UI/SiteRouter.razor | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Oqtane.Client/Themes/Controls/Theme/ControlPanelInteractive.razor b/Oqtane.Client/Themes/Controls/Theme/ControlPanelInteractive.razor index 77812f60a..d2f8b1047 100644 --- a/Oqtane.Client/Themes/Controls/Theme/ControlPanelInteractive.razor +++ b/Oqtane.Client/Themes/Controls/Theme/ControlPanelInteractive.razor @@ -185,9 +185,12 @@
@@ -284,8 +287,7 @@ } } - var themes = await ThemeService.GetThemesAsync(); - _containers = ThemeService.GetContainerControls(themes, PageState.Page.ThemeType); + _containers = ThemeService.GetContainerControls(PageState.Site.Themes, PageState.Page.ThemeType); _containerType = PageState.Site.DefaultContainerType; _allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId); _moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(_category)).ToList(); diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index e37aac519..ee09f0aa2 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -299,9 +299,12 @@ RenderId = Guid.NewGuid(), Refresh = false }; - OnStateChange?.Invoke(_pagestate); - await ScrollToFragment(_pagestate.Uri); + + if (PageState.RenderMode == RenderModes.Interactive) + { + await ScrollToFragment(_pagestate.Uri); + } } else {