Skip to content

Commit 782b663

Browse files
committed
improve readability
1 parent 7ba4b72 commit 782b663

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/api/mailboxes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ module.exports = (db, server, mailboxHandler) => {
638638

639639
const updateResult = await updateMailbox(user, mailbox, updates);
640640

641-
if ('retention' in updates && updateResult && updateResult.changes && updateResult.changes.retention) {
641+
if ('retention' in updates && updateResult?.changes?.retention) {
642642
await taskHandler.ensure(
643643
'mailbox-retention',
644644
{ user, mailbox },

lib/tools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async function getMailboxCounter(db, mailbox, type) {
212212
}
213213

214214
function getMessageRetentionState(mailboxData, addedAt = Date.now()) {
215-
const retention = Math.max(0, Number((mailboxData && mailboxData.retention) || 0) || 0);
215+
const retention = mailboxData?.retention || 0;
216216

217217
if (!retention) {
218218
return {

0 commit comments

Comments
 (0)