Skip to content

Commit 3686ed8

Browse files
committed
fix: replace old plugin store value with new one
1 parent 0143e81 commit 3686ed8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Shared/Components/Plugin/utils.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const pluginTagSelectStyles = {
9999
}
100100

101101
/**
102-
* @description This method takes the initial plugin data store and updates only keys that are not present in the initial store with the values from the target store.
102+
* @description This method takes the initial plugin data store and updates the keys with the target parent plugin store and plugin version store
103103
*/
104104
export const getUpdatedPluginStore = (
105105
initialPluginDataStore: PluginDataStoreType,
@@ -109,15 +109,11 @@ export const getUpdatedPluginStore = (
109109
const clonedPluginDataStore = structuredClone(initialPluginDataStore)
110110

111111
Object.keys(targetParentPluginStore).forEach((key) => {
112-
if (!clonedPluginDataStore.parentPluginStore[key]) {
113-
clonedPluginDataStore.parentPluginStore[key] = targetParentPluginStore[key]
114-
}
112+
clonedPluginDataStore.parentPluginStore[key] = targetParentPluginStore[key]
115113
})
116114

117115
Object.keys(targetPluginVersionStore).forEach((key) => {
118-
if (!clonedPluginDataStore.pluginVersionStore[key]) {
119-
clonedPluginDataStore.pluginVersionStore[key] = targetPluginVersionStore[key]
120-
}
116+
clonedPluginDataStore.pluginVersionStore[key] = targetPluginVersionStore[key]
121117
})
122118

123119
return clonedPluginDataStore

0 commit comments

Comments
 (0)