File tree Expand file tree Collapse file tree
tasks-app-shared/src/commonMain/kotlin/net/opatry/tasks/app/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2024 Olivier Patry
2+ * Copyright (c) 2025 Olivier Patry
33 *
44 * Permission is hereby granted, free of charge, to any person obtaining
55 * a copy of this software and associated documentation files (the "Software"),
@@ -28,8 +28,8 @@ import io.ktor.client.HttpClient
2828import io.ktor.client.call.body
2929import io.ktor.client.request.get
3030import io.ktor.http.isSuccess
31- import kotlinx.coroutines.flow.Flow
3231import kotlinx.coroutines.flow.MutableStateFlow
32+ import kotlinx.coroutines.flow.asStateFlow
3333import kotlinx.coroutines.launch
3434import kotlinx.datetime.Clock
3535import net.opatry.google.auth.GoogleAuthenticator
@@ -68,8 +68,7 @@ class UserViewModel(
6868) : ViewModel() {
6969
7070 private val _state = MutableStateFlow <UserState ?>(null )
71- val state: Flow <UserState ?>
72- get() = _state
71+ val state = _state .asStateFlow()
7372
7473 private suspend fun fetchUserInfo (): UserInfo ? {
7574 return try {
You can’t perform that action at this time.
0 commit comments