Skip to content

Commit

Permalink
Fix filter expiry wrongly set if there's no expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Apr 28, 2024
1 parent 5433e4e commit 11e64a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 11e64a2

Please sign in to comment.