* Writes the user's data to the database.
( userId: string, name: string | null, email: string | null, imageUrl: string | null, )
| 501 | * Writes the user's data to the database. |
| 502 | */ |
| 503 | function writeUserData( |
| 504 | userId: string, |
| 505 | name: string | null, |
| 506 | email: string | null, |
| 507 | imageUrl: string | null, |
| 508 | ) { |
| 509 | set(ref(database, 'users/' + userId), { |
| 510 | username: name, |
| 511 | email: email, |
| 512 | profile_picture: imageUrl, |
| 513 | }); |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * Cleanups the UI and removes all Firebase listeners. |