From d7746f4ddcf939f6d1695f1d726307c53f083712 Mon Sep 17 00:00:00 2001 From: Eric Wassail Date: Wed, 13 Mar 2024 10:10:07 -0400 Subject: [PATCH] reset space configuration cache when setting catalog path --- Elements.Components/src/ContentCatalogRetrieval.cs | 3 ++- Elements.Components/src/SpaceConfiguration.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Elements.Components/src/ContentCatalogRetrieval.cs b/Elements.Components/src/ContentCatalogRetrieval.cs index eaf65cea3..3f9f5526f 100644 --- a/Elements.Components/src/ContentCatalogRetrieval.cs +++ b/Elements.Components/src/ContentCatalogRetrieval.cs @@ -18,7 +18,7 @@ public static class ContentCatalogRetrieval private static string catalogFilePath = null; /// - /// If you're using a different location for the catalog file, you can + /// If you're using a different location for the catalog file, you can /// set it here. /// /// @@ -27,6 +27,7 @@ public static void SetCatalogFilePath(string path) catalogFilePath = path; // if we already have a catalog loaded, clear it out. catalog = null; + SpaceConfiguration.ResetContentCache(); } /// diff --git a/Elements.Components/src/SpaceConfiguration.cs b/Elements.Components/src/SpaceConfiguration.cs index 29ca8f048..a8eb44ccf 100644 --- a/Elements.Components/src/SpaceConfiguration.cs +++ b/Elements.Components/src/SpaceConfiguration.cs @@ -14,6 +14,14 @@ namespace Elements.Components public class SpaceConfiguration : Dictionary { internal static Dictionary contentDict = new Dictionary(); + + /// + /// Clear the internal content cache. Do this if content catalogs have changed. + /// + public static void ResetContentCache() + { + contentDict.Clear(); + } } ///