Complete merge.
This commit is contained in:
1 parent
e73d827d21
commit
7d2dbda5d1
3 files changed
+10
-198
No files matched your search
@@ -4,7 +4,16 @@ import { useBoard } from '@/components/hooks';
|
||||
|
||||
export function BoardControls() {
|
||||
const { board } = useBoard();
|
||||
const websiteId = board?.parameters?.websiteId;
|
||||
const boardWebsiteId = board?.parameters?.websiteId;
|
||||
const componentWebsiteIds = board?.parameters?.rows
|
||||
?.flatMap(row => row.columns)
|
||||
.map(column => column.component?.websiteId)
|
||||
.filter(Boolean);
|
||||
const fallbackWebsiteId =
|
||||
componentWebsiteIds && new Set(componentWebsiteIds).size === 1
|
||||
? componentWebsiteIds[0]
|
||||
: undefined;
|
||||
const websiteId = boardWebsiteId || fallbackWebsiteId;
|
||||
|
||||
if (!websiteId) {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user