Fix issue where cards are invisible on first load
This commit is contained in:
@@ -97,18 +97,18 @@ onMount(() => {
|
|||||||
// Apply the view settings from localstorage
|
// Apply the view settings from localstorage
|
||||||
try {
|
try {
|
||||||
const layout = JSON.parse(window.localStorage.getItem("dashboard_layout"))
|
const layout = JSON.parse(window.localStorage.getItem("dashboard_layout"))
|
||||||
if (layout === null) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const card of cards) {
|
for (const card of cards) {
|
||||||
if (layout.size !== undefined && layout.size[card.id] !== undefined) {
|
if (
|
||||||
|
layout !== null &&
|
||||||
|
layout.size !== undefined &&
|
||||||
|
layout.size[card.id] !== undefined
|
||||||
|
) {
|
||||||
card.size = layout.size[card.id]
|
card.size = layout.size[card.id]
|
||||||
} else {
|
} else {
|
||||||
card.size = 1
|
card.size = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(cards)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn("Failed to load dashboard settings", err)
|
console.warn("Failed to load dashboard settings", err)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user