fix: import sidebar issues (#1712)
This commit is contained in:
@@ -81,13 +81,26 @@ export const moveWidgetsAndAppsIfMerge = (
|
||||
}
|
||||
|
||||
if (configuration.sidebarBehaviour === "last-section") {
|
||||
if (old.settings.customization.layout.enabledLeftSidebar) {
|
||||
const areas = [...old.apps.map((app) => app.area), ...old.widgets.map((widget) => widget.area)];
|
||||
if (
|
||||
old.settings.customization.layout.enabledLeftSidebar ||
|
||||
areas.some((area) => area.type === "sidebar" && area.properties.location === "left")
|
||||
) {
|
||||
offset = moveWidgetsAndAppsInLeftSidebar(old, firstId, offset, configuration.screenSize);
|
||||
}
|
||||
|
||||
if (old.settings.customization.layout.enabledRightSidebar) {
|
||||
if (
|
||||
old.settings.customization.layout.enabledRightSidebar ||
|
||||
areas.some((area) => area.type === "sidebar" && area.properties.location === "right")
|
||||
) {
|
||||
moveWidgetsAndAppsInRightSidebar(old, firstId, offset, configuration.screenSize);
|
||||
}
|
||||
} else {
|
||||
// Remove all widgets and apps in the sidebar
|
||||
return {
|
||||
apps: old.apps.filter((app) => app.area.type !== "sidebar"),
|
||||
widgets: old.widgets.filter((app) => app.area.type !== "sidebar"),
|
||||
};
|
||||
}
|
||||
|
||||
return { apps: old.apps, widgets: old.widgets };
|
||||
|
||||
Reference in New Issue
Block a user