From 0443cca32141a69d941e0a4aa8d164a883cdaf98 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 21 Sep 2022 16:19:07 +0100 Subject: [PATCH] Fix error when plugin is added --- packages/builder/src/stores/portal/plugins.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 8997e8f49d..e259f9aa6d 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -34,8 +34,7 @@ export function createPluginsStore() { } let res = await API.createPlugin(pluginData) - - let newPlugin = res.plugins[0] + let newPlugin = res.plugin update(state => { const currentIdx = state.findIndex(plugin => plugin._id === newPlugin._id) if (currentIdx >= 0) {