Skip to content

Commit

Permalink
Convert floats to longs for when in notification data
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelgrom committed Feb 8, 2025
1 parent cb99f4c commit 50191f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,9 @@ class MessagingManager @Inject constructor(
data: Map<String, String>
) {
try { // Without this, a non-numeric when value will crash the app
var notificationWhen = data[WHEN]?.toLongOrNull()?.times(1000) ?: 0
val isRelative = data[WHEN_RELATIVE]?.toBoolean() ?: false
val usesChronometer = data[CHRONOMETER]?.toBoolean() ?: false
var notificationWhen = data[WHEN]?.toLongOrNull()?.times(1000) ?: data[WHEN]?.toFloatOrNull()?.times(1000)?.toLong() ?: 0
val isRelative = data[WHEN_RELATIVE]?.toBoolean() == true
val usesChronometer = data[CHRONOMETER]?.toBoolean() == true

if (notificationWhen != 0L) {
if (isRelative) {
Expand Down

0 comments on commit 50191f2

Please sign in to comment.