mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
🐛 Fix wrong position of wrapper when migrating from old schema
This commit is contained in:
@@ -14,7 +14,11 @@ export const DashboardWrapper = ({ wrapper }: DashboardWrapperProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={apps.length > 0 || isEditMode ? defaultClasses : `${defaultClasses} gridstack-empty-wrapper`}
|
className={
|
||||||
|
apps.length > 0 || widgets.length > 0 || isEditMode
|
||||||
|
? defaultClasses
|
||||||
|
: `${defaultClasses} gridstack-empty-wrapper`
|
||||||
|
}
|
||||||
style={{ transitionDuration: '0s' }}
|
style={{ transitionDuration: '0s' }}
|
||||||
data-wrapper={wrapper.id}
|
data-wrapper={wrapper.id}
|
||||||
ref={refs.wrapper}
|
ref={refs.wrapper}
|
||||||
|
|||||||
@@ -131,10 +131,19 @@ const getConfigAndCreateIfNotExsists = (
|
|||||||
const category: CategoryType = {
|
const category: CategoryType = {
|
||||||
id: uuidv4(),
|
id: uuidv4(),
|
||||||
name: categoryName,
|
name: categoryName,
|
||||||
position: config.categories.length,
|
position: config.categories.length + 1, // sync up with index of categories
|
||||||
};
|
};
|
||||||
|
|
||||||
config.categories.push(category);
|
config.categories.push(category);
|
||||||
|
|
||||||
|
// sync up with categories
|
||||||
|
if (config.wrappers.length < config.categories.length) {
|
||||||
|
config.wrappers.push({
|
||||||
|
id: uuidv4(),
|
||||||
|
position: config.wrappers.length + 1, // sync up with index of categories
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return category;
|
return category;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user