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,16 +667,14 @@ export const getFrontendStore = () => {
})
// Select the parent if cutting
if (cut) {
if (cut && selectParent) {
const screen = get(selectedScreen)
const parent = findComponentParent(screen?.props, component._id)
if (parent) {
if (selectParent) {
store.update(state => {
state.selectedComponentId = parent._id
return state
})
}
store.update(state => {
state.selectedComponentId = parent._id
return state
})
}
}
},

View File

@ -86,7 +86,11 @@
: [],
isBudibaseEvent: true,
usedPlugins: $store.usedPlugins,
location: window.location,
location: {
protocol: window.location.protocol,
hostname: window.location.hostname,
port: window.location.port,
},
}
// Refresh the preview when required
@ -189,7 +193,7 @@
// Cut and paste the component to the new 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)
}
} else if (type === "click-nav") {