Skip to content

Commit

Permalink
Merge pull request #1080 from hypar-io/reset-space-configuration-cache
Browse files Browse the repository at this point in the history
reset space configuration cache when setting catalog path (#1080)
  • Loading branch information
wynged committed Mar 13, 2024
2 parents 896616d + d7746f4 commit 4816fbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Elements.Components/src/ContentCatalogRetrieval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class ContentCatalogRetrieval
private static string catalogFilePath = null;

/// <summary>
/// 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.
/// </summary>
/// <param name="path"></param>
Expand All @@ -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();
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions Elements.Components/src/SpaceConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ namespace Elements.Components
public class SpaceConfiguration : Dictionary<string, ContentConfiguration>
{
internal static Dictionary<string, ContentElement> contentDict = new Dictionary<string, ContentElement>();

/// <summary>
/// Clear the internal content cache. Do this if content catalogs have changed.
/// </summary>
public static void ResetContentCache()
{
contentDict.Clear();
}
}

/// <summary>
Expand Down

0 comments on commit 4816fbd

Please sign in to comment.