fix(reminders): do not show relative reminders as minutes when they round to hours

Regression from fd520dab0a
This commit is contained in:
kolaente 2024-04-22 00:05:12 +02:00
parent 26ada628a2
commit 15e0c716ad
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 6 deletions

View File

@ -19,16 +19,16 @@ export function secondsToPeriod(seconds: number): { unit: PeriodUnit, amount: nu
}
}
if (seconds % SECONDS_A_MINUTE === 0) {
if (seconds % SECONDS_A_HOUR === 0) {
return {
unit: 'minutes',
amount: seconds / SECONDS_A_MINUTE,
unit: 'hours',
amount: seconds / SECONDS_A_HOUR,
}
}
return {
unit: 'hours',
amount: seconds / SECONDS_A_HOUR,
unit: 'minutes',
amount: seconds / SECONDS_A_MINUTE,
}
}