This commit is contained in:
Andrew Kingston 2022-10-24 09:43:45 +01:00
parent c111f02e70
commit fb0866f0d9
2 changed files with 8 additions and 15 deletions

View File

@ -124,6 +124,7 @@
if (!message?.data?.type) {
return
}
console.debug(`CLIENT: [${message.data.type}]`)
// Await the event handler
try {
@ -139,20 +140,11 @@
}
const handleBudibaseEvent = async event => {
const { type, data } = event.data || event.detail
if (!type) {
return
}
const { type, data } = event.data
if (type === MessageTypes.READY) {
// Initialise the app when mounted
if ($store.clientFeatures.messagePassing) {
if (!loading) return
}
// Display preview immediately if the intelligent loading feature
// is not supported
if (!$store.clientFeatures.intelligentLoading) {
loading = false
if (!loading) {
return
}
refreshContent(json)
} else if (type === MessageTypes.ERROR) {

View File

@ -7,10 +7,12 @@
let gridStyles
let id
// Some memoisation of primitive types for performance
$: jsonStyles = JSON.stringify(gridStyles)
$: id = dragInfo?.id || id
$: instance = componentStore.actions.getComponentInstance(id)
$: instance?.setEphemeralStyles({
// Set ephemeral grid styles on the dragged component
$: componentStore.actions.getComponentInstance(id)?.setEphemeralStyles({
...gridStyles,
...(gridStyles ? { "z-index": 999 } : null),
})
@ -193,7 +195,6 @@
// Callback when drag stops (whether dropped or not)
const stopDragging = async () => {
console.log("STOP")
// Save changes
if (gridStyles) {
await builderStore.actions.updateStyles(gridStyles, dragInfo.id)