Skip to content

Commit 4f8dfe9

Browse files
committed
Improve intializing User instance
1 parent c445124 commit 4f8dfe9

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

app/src/main/java/com/example/chattutorial/MainActivity.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ class MainActivity : AppCompatActivity() {
2323
ChatDomain.Builder(client, applicationContext).build()
2424

2525
// 2 - Authenticate and connect the user
26-
val user = User(
27-
id = "tutorial-droid",
28-
extraData = mutableMapOf(
29-
"name" to "Tutorial Droid",
30-
"image" to "https://bit.ly/2TIt8NR",
31-
),
32-
)
26+
val user = User(id = "tutorial-droid").apply {
27+
name = "Tutorial Droid"
28+
image = "https://bit.ly/2TIt8NR"
29+
}
3330
client.connectUser(
3431
user = user,
3532
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidHV0b3JpYWwtZHJvaWQifQ.NhEr0hP9W9nwqV7ZkdShxvi02C5PR7SJE7Cs4y7kyqg"

0 commit comments

Comments
 (0)