aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-02-19 23:35:37 -0600
committerIván Ávalos <avalos@disroot.org>2022-02-19 23:35:37 -0600
commitbf038830e299dface34f6938d3ffdef83b5ff949 (patch)
tree3037208c5906e4f45656e9d8a0fc98a273e05446 /shared/src/commonMain
parent203471d59b06f0dd49fdcd95350601f7068b3dab (diff)
parentdfd9ba657b93a6f5b98246f6d174e02cc4132d46 (diff)
downloadetbsa-trackermap-mobile-bf038830e299dface34f6938d3ffdef83b5ff949.tar.gz
etbsa-trackermap-mobile-bf038830e299dface34f6938d3ffdef83b5ff949.tar.bz2
etbsa-trackermap-mobile-bf038830e299dface34f6938d3ffdef83b5ff949.zip
Merge branch 'main' of https://git.sr.ht/~avalos/trackermap-mobile
Diffstat (limited to 'shared/src/commonMain')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt4
1 files changed, 3 insertions, 1 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..48352bf 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