Skip to content

Commit

Permalink
Disable unarchive for overdue wishlist items
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrl committed Jan 18, 2024
1 parent 834bc82 commit 5856b8c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/Wishlist.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,15 @@
</span>
</TableBodyCell>
<TableHeadCell>
<A
class="group-hover:visible invisible cursor-pointer inline-flex mr-4"
title="Unarchive"
on:click={() => onToggle(item)}
><ArchiveOutline class="cursor-pointer text-amber-500" /></A
>
<!-- If the color is gray, then it's overdue and can't be unarchived. Too lazy to not use an existing check for it -->
{#if getDueDateColor(new Date(), new Date(item.dateEnds)) !== 'text-gray-500'}
<A
class="group-hover:visible invisible cursor-pointer inline-flex mr-4"
title="Unarchive"
on:click={() => onToggle(item)}
><ArchiveOutline class="cursor-pointer text-amber-500" />
</A>
{/if}
<A
class="group-hover:visible invisible cursor-pointer inline-flex"
title="Remove"
Expand Down

0 comments on commit 5856b8c

Please sign in to comment.