Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion web/src/lib/components/SharedLinkExpiration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@
<SettingSelect
bind:value={expirationOption}
{onSelect}
options={[...new Set([...expiredDateOptions, getExpirationOption(createdAt, expiresAt)])]}
options={(() => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably cleaner to extract this into a method instead of inlining it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in a62ea4a

const allOptions = [...expiredDateOptions, getExpirationOption(createdAt, expiresAt)];
const seen = new Set<string | number>();

Check failure on line 73 in web/src/lib/components/SharedLinkExpiration.svelte

View workflow job for this annotation

GitHub Actions / Lint Web

Found a mutable instance of the built-in Set class. Use SvelteSet instead
return allOptions.filter((option) => {
if (seen.has(option.value)) {
return false;
}
seen.add(option.value);
return true;
});
})()}
label={$t('expire_after')}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and that's the "55 years old" and crash fix

disabled={expiresAt !== null && DateTime.fromISO(expiresAt) < DateTime.now()}
number={true}
Expand Down
Loading