Fix filter expiry wrongly set if there's no expiry

This commit is contained in:
Lim Chee Aun 2024-04-26 09:58:07 +08:00
parent 5433e4e119
commit 11e64a2cc4

View file

@ -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;