Skip to content

Commit c8150cf

Browse files
committed
refactor(ui): simplifies hasUpdate memo with destructured timeInfo
1 parent 945ba48 commit c8150cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/components/dashboard/ItemRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export default function ItemRow(props: ItemRowProps) {
3838
const hasUpdate = createMemo(() => {
3939
const diff = new Date(props.updatedAt).getTime() - new Date(props.createdAt).getTime();
4040
if (diff <= 60_000) return false;
41-
if (timeInfo().created === "" || timeInfo().updated === "") return false;
42-
return timeInfo().created !== timeInfo().updated;
41+
const { created, updated } = timeInfo();
42+
return created !== "" && updated !== "" && created !== updated;
4343
});
4444

4545
return (

0 commit comments

Comments
 (0)