diff --git a/lerna.json b/lerna.json index 5e0bc09825..dde9cf03a0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.2.29", + "version": "3.2.32", "npmClient": "yarn", "concurrency": 20, "command": { diff --git a/packages/builder/src/stores/builder/automations.ts b/packages/builder/src/stores/builder/automations.ts index c43a856cc4..9b20b4cd03 100644 --- a/packages/builder/src/stores/builder/automations.ts +++ b/packages/builder/src/stores/builder/automations.ts @@ -291,8 +291,8 @@ const automationActions = (store: AutomationStore) => ({ let result: (AutomationStep | AutomationTrigger)[] = [] pathWay.forEach(path => { const { stepIdx, branchIdx } = path - let last = result ? result[result.length - 1] : [] - if (!result) { + let last = result.length ? result[result.length - 1] : [] + if (!result.length) { // Preceeding steps. result = steps.slice(0, stepIdx + 1) return diff --git a/packages/frontend-core/src/components/grid/cells/BBReferenceCell.svelte b/packages/frontend-core/src/components/grid/cells/BBReferenceCell.svelte index 5d98ba903b..fe6d8945ba 100644 --- a/packages/frontend-core/src/components/grid/cells/BBReferenceCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/BBReferenceCell.svelte @@ -26,7 +26,7 @@ : RelationshipType.MANY_TO_MANY, } - async function searchFunction(searchParams) { + async function searchFunction(_tableId, searchParams) { if ( subtype !== BBReferenceFieldSubType.USER && subtype !== BBReferenceFieldSubType.USERS diff --git a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts index 4dc5a44fd5..8b928364e1 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts @@ -151,6 +151,35 @@ export const initialise = (context: StoreContext) => { }) ) + function sortHasChanged( + newSort: { + column: string | null | undefined + order: SortOrder + }, + existingSort?: { + field: string + order?: SortOrder + } + ) { + const newColumn = newSort.column ?? null + const existingColumn = existingSort?.field ?? null + if (newColumn !== existingColumn) { + return true + } + + if (!newColumn) { + return false + } + + const newOrder = newSort.order ?? null + const existingOrder = existingSort?.order ?? null + if (newOrder !== existingOrder) { + return true + } + + return false + } + // When sorting changes, ensure view definition is kept up to date unsubscribers.push( sort.subscribe(async $sort => { @@ -161,10 +190,7 @@ export const initialise = (context: StoreContext) => { } // Skip if nothing actually changed - if ( - $sort?.column === $view.sort?.field && - $sort?.order === $view.sort?.order - ) { + if (!sortHasChanged($sort, $view.sort)) { return }