From 57bb847b3c2a76fe60d2216a5b6c066466a457a9 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 23 Jul 2024 18:11:37 -0500 Subject: [PATCH] Tweaks --- src/components/dialogs/MutedWords.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/dialogs/MutedWords.tsx b/src/components/dialogs/MutedWords.tsx index dca2515bcf..600955e409 100644 --- a/src/components/dialogs/MutedWords.tsx +++ b/src/components/dialogs/MutedWords.tsx @@ -68,15 +68,17 @@ function MutedWordsInner() { ) as AppBskyActorDefs.MutedWord['targets'] const actorTarget = excludeFollowing ? 'exclude-following' : 'all' + const now = Date.now() const rawDuration = durations.at(0) + // undefined evaluates to 'forever' let duration: string | undefined if (rawDuration === '24_hours') { - duration = new Date(Date.now() + ONE_DAY).toISOString() + duration = new Date(now + ONE_DAY).toISOString() } else if (rawDuration === '7_days') { - duration = new Date(Date.now() + 7 * ONE_DAY).toISOString() + duration = new Date(now + 7 * ONE_DAY).toISOString() } else if (rawDuration === '30_days') { - duration = new Date(Date.now() + 30 * ONE_DAY).toISOString() + duration = new Date(now + 30 * ONE_DAY).toISOString() } if (!sanitizedValue || !surfaces.length) { @@ -297,7 +299,7 @@ function MutedWordsInner() { Options: