aboutsummaryrefslogtreecommitdiff
path: root/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt
index d3deca1..0faaa72 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt
@@ -113,7 +113,7 @@ class SessionController(
try {
userFlow.value?.let { user ->
val attributes = user.attributes.toMutableMap()
- attributes["notificationTokens"].toString().let { tokens ->
+ attributes["notificationTokens"]?.content?.let { tokens ->
if (tokens == "null" || !tokens.contains(token)) {
if (tokens == "null") {
attributes["notificationTokens"] = JsonPrimitive(token)
@@ -123,6 +123,8 @@ class SessionController(
}
+ } ?: run {
+ attributes["notificationTokens"] = JsonPrimitive(token)
}
usersApi.usersIdPut(user.copy(
attributes = attributes
@@ -138,7 +140,7 @@ class SessionController(
try {
userFlow.value?.let { user ->
val attributes = user.attributes.toMutableMap()
- attributes["notificationTokens"].toString().let { tokens ->
+ attributes["notificationTokens"]?.content?.let { tokens ->
if (tokens.contains("$token,")) {
attributes["notificationTokens"] =
JsonPrimitive(token.replace("$token,", ""))