zero-knowledge file sharing
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix plural in duration

Juliet 0980e4c9 5aa00bc7

+8 -3
+8 -3
web/src/lib/utils.ts
··· 88 88 export function formatExpiry(unixSec: number): string { 89 89 const secs = unixSec - Math.floor(Date.now() / 1000); 90 90 if (secs < 60) return "expires in less than a minute"; 91 - if (secs < 3600) return `expires in ${Math.floor(secs / 60)} minutes`; 92 - if (secs < 86400) return `expires in ${Math.floor(secs / 3600)} hours`; 93 - return `expires in ${Math.floor(secs / 86400)} days`; 91 + const mins = Math.floor(secs / 60); 92 + if (secs < 3600) 93 + return `expires in ${mins} ${mins === 1 ? "minute" : "minutes"}`; 94 + const hours = Math.floor(secs / 3600); 95 + if (secs < 86400) 96 + return `expires in ${hours} ${hours === 1 ? "hour" : "hours"}`; 97 + const days = Math.floor(secs / 86400); 98 + return `expires in ${days} ${days === 1 ? "day" : "days"}`; 94 99 } 95 100 96 101 export function triggerDownload(blob: Blob, fileName: string) {