Improve performance by fixing multiple instances of redundant client app initialisations

This commit is contained in:
Andrew Kingston 2022-10-21 16:54:01 +01:00
parent 575636ed3d
commit 6e0e89bbf7
2 changed files with 11 additions and 9 deletions

View File

@ -667,18 +667,16 @@ export const getFrontendStore = () => {
}) })
// Select the parent if cutting // Select the parent if cutting
if (cut) { if (cut && selectParent) {
const screen = get(selectedScreen) const screen = get(selectedScreen)
const parent = findComponentParent(screen?.props, component._id) const parent = findComponentParent(screen?.props, component._id)
if (parent) { if (parent) {
if (selectParent) {
store.update(state => { store.update(state => {
state.selectedComponentId = parent._id state.selectedComponentId = parent._id
return state return state
}) })
} }
} }
}
}, },
paste: async (targetComponent, mode, targetScreen) => { paste: async (targetComponent, mode, targetScreen) => {
const state = get(store) const state = get(store)

View File

@ -86,7 +86,11 @@
: [], : [],
isBudibaseEvent: true, isBudibaseEvent: true,
usedPlugins: $store.usedPlugins, usedPlugins: $store.usedPlugins,
location: window.location, location: {
protocol: window.location.protocol,
hostname: window.location.hostname,
port: window.location.port,
},
} }
// Refresh the preview when required // Refresh the preview when required
@ -189,7 +193,7 @@
// Cut and paste the component to the new destination // Cut and paste the component to the new destination
if (source && destination) { if (source && destination) {
store.actions.components.copy(source, true) store.actions.components.copy(source, true, false)
await store.actions.components.paste(destination, data.mode) await store.actions.components.paste(destination, data.mode)
} }
} else if (type === "click-nav") { } else if (type === "click-nav") {