From 11e64a2cc4714b1aefd21fbff51c35f53a6bfa75 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 26 Apr 2024 09:58:07 +0800 Subject: [PATCH] Fix filter expiry wrongly set if there's no expiry --- src/pages/filters.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/filters.jsx b/src/pages/filters.jsx index a0c05118..0d83d27e 100644 --- a/src/pages/filters.jsx +++ b/src/pages/filters.jsx @@ -286,7 +286,13 @@ function FiltersAddEdit({ filter, onClose }) { // Preserve existing expiry if not specified // Seconds from now to expiresAtDate // Other clients don't do this - expiresIn = Math.floor((expiresAtDate - new Date()) / 1000); + if (hasExpiry) { + expiresIn = Math.floor( + (expiresAtDate - new Date()) / 1000, + ); + } else { + expiresIn = null; + } } else if (expiresIn === '0' || expiresIn === 0) { // 0 = Never expiresIn = null;