Fix for settings definition cache getting overwritten when both table and gridblock are on the same screen

This commit is contained in:
Dean 2024-03-21 14:30:18 +00:00
parent 5066f54525
commit 7d1c9b1337
1 changed files with 8 additions and 5 deletions

View File

@ -246,15 +246,18 @@
return return
} }
const cacheId = `${definition.name}${
definition?.deprecated === true ? "_deprecated" : ""
}`
// Get the settings definition for this component, and cache it // Get the settings definition for this component, and cache it
if (SettingsDefinitionCache[definition.name]) { if (SettingsDefinitionCache[cacheId]) {
settingsDefinition = SettingsDefinitionCache[definition.name] settingsDefinition = SettingsDefinitionCache[cacheId]
settingsDefinitionMap = SettingsDefinitionMapCache[definition.name] settingsDefinitionMap = SettingsDefinitionMapCache[cacheId]
} else { } else {
settingsDefinition = getSettingsDefinition(definition) settingsDefinition = getSettingsDefinition(definition)
settingsDefinitionMap = getSettingsDefinitionMap(settingsDefinition) settingsDefinitionMap = getSettingsDefinitionMap(settingsDefinition)
SettingsDefinitionCache[definition.name] = settingsDefinition SettingsDefinitionCache[cacheId] = settingsDefinition
SettingsDefinitionMapCache[definition.name] = settingsDefinitionMap SettingsDefinitionMapCache[cacheId] = settingsDefinitionMap
} }
// Parse the instance settings, and cache them // Parse the instance settings, and cache them