mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fixed TypeError: Cannot read properties of undefined (reading 'website_id')
This commit is contained in:
parent
0f976be5d8
commit
aaf0effcbb
@ -23,7 +23,6 @@ export default function DashboardEdit({ websites }) {
|
|||||||
|
|
||||||
const ordered = useMemo(() => sortArrayByMap(websites, order, 'website_id'), [websites, order]);
|
const ordered = useMemo(() => sortArrayByMap(websites, order, 'website_id'), [websites, order]);
|
||||||
|
|
||||||
console.log({ order, ordered });
|
|
||||||
|
|
||||||
function handleWebsiteDrag({ destination, source }) {
|
function handleWebsiteDrag({ destination, source }) {
|
||||||
if (!destination || destination.index === source.index) return;
|
if (!destination || destination.index === source.index) return;
|
||||||
@ -32,7 +31,7 @@ export default function DashboardEdit({ websites }) {
|
|||||||
const [removed] = orderedWebsites.splice(source.index, 1);
|
const [removed] = orderedWebsites.splice(source.index, 1);
|
||||||
orderedWebsites.splice(destination.index, 0, removed);
|
orderedWebsites.splice(destination.index, 0, removed);
|
||||||
|
|
||||||
setOrder(orderedWebsites.map(({ website_id }) => website_id));
|
setOrder(orderedWebsites.map((website) => website?.website_id || 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSave() {
|
function handleSave() {
|
||||||
|
Loading…
Reference in New Issue
Block a user