Fixed memoization on null

This commit is contained in:
Kasper Juul Hermansen 2021-11-21 17:16:53 +01:00
parent 107ac563e0
commit 09d71b71d8
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationConfigOverride">
<CommitMessageValidationOverride>
<option name="enabled" value="true" />
</CommitMessageValidationOverride>
</option>
</component>
</project>

View File

@ -35,6 +35,12 @@ export const TodoShortForm = (props: {
/> />
</div> </div>
<div className="flex flex-row pb-1"> <div className="flex flex-row pb-1">
<AddProjectButton
onProjectChanged={props.onProjectChanged}
initialProject={props.project}
>
{props.project}
</AddProjectButton>
<AddProjectButton <AddProjectButton
onProjectChanged={props.onProjectChanged} onProjectChanged={props.onProjectChanged}
initialProject={props.project} initialProject={props.project}

View File

@ -10,7 +10,7 @@ const HomePage = () => {
const { data, isLoading } = todosApi.useGetActiveTodosQuery(); const { data, isLoading } = todosApi.useGetActiveTodosQuery();
const onlyActiveTodos = useMemo( const onlyActiveTodos = useMemo(
() => data.filter((t) => t.status === false), () => data?.filter((t) => t.status === false),
[data] [data]
); );
const groupedTodos = useMemo( const groupedTodos = useMemo(