dashboard bugfix - handle initial visit with no saved solutions
This commit is contained in:
parent
48ae4d607e
commit
a390bc7615
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ const colorStrings = [
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
const { connections, store } = useAppModel();
|
const { connections, store } = useAppModel();
|
||||||
const nextUnsolvedId = createMemo(() => {
|
const nextUnsolvedId = createMemo(() => {
|
||||||
return connections.find((x) => store.solutions[x.id] === undefined)?.id;
|
return connections.find((x) => (store.solutions ?? [])[x.id] === undefined)?.id;
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -78,7 +78,7 @@ export default function Dashboard() {
|
||||||
<div class={styles.calendar}>
|
<div class={styles.calendar}>
|
||||||
<For each={connections}>
|
<For each={connections}>
|
||||||
{(item) => {
|
{(item) => {
|
||||||
const isSolved = store.solutions[item.id] !== undefined;
|
const isSolved = (store.solutions ?? [])[item.id] !== undefined;
|
||||||
const date = new Date(item.date);
|
const date = new Date(item.date);
|
||||||
const showHeader = item.id === 1 || date.getDate() === 1;
|
const showHeader = item.id === 1 || date.getDate() === 1;
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue