refactor: move expiration options into consts.ts

This commit is contained in:
2026-01-25 04:24:39 -05:00
parent 01efa399cf
commit a6b98a97f8
3 changed files with 24 additions and 32 deletions
+2 -16
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import type { PageData } from './$types';
import { syntaxes } from '$lib/consts';
import { syntaxes, expiresOptions } from '$lib/consts';
import { user } from '$lib/stores/user';
import { getToken } from '$lib/utils/auth';
import { onMount } from 'svelte';
@@ -108,21 +108,7 @@
label: syntaxes[lang]?.name ?? lang.charAt(0).toUpperCase() + lang.slice(1)
})) ?? [];
const expiresOptions = [
{ value: 0, label: 'Never Expire' },
{ value: 600000, label: 'Expire in 10 Minutes' },
{ value: 3600000, label: 'Expire in 1 Hour' },
{ value: 86400000, label: 'Expire in 1 Day' },
{ value: 604800000, label: 'Expire in 1 Week' },
{ value: 1209600000, label: 'Expire in 2 Weeks' },
{ value: 2592000000, label: 'Expire in 1 Month' },
{ value: 7776000000, label: 'Expire in 3 Months' },
{ value: 15552000000, label: 'Expire in 6 Months' },
{ value: 31536000000, label: 'Expire in 1 Year' },
{ value: 63072000000, label: 'Expire in 2 Years' },
{ value: 157680000000, label: 'Expire in 5 Years' },
{ value: 315360000000, label: 'Expire in 10 Years' }
];
const visibilityOptions =
data.options?.visibilities?.map((visibility: { value: number; displayName: string }) => ({