Fixes stability of Profile viewmodels

This commit is contained in:
Vitor Pamplona
2026-02-06 15:54:08 -05:00
parent e97a30fcb1
commit 130a83f0b9
10 changed files with 19 additions and 1 deletions
@@ -49,7 +49,7 @@ class UserMetadataState(
fun getUserMetadataFlow() = note.flow().metadata.stateFlow
fun getUserMetadataEvent(): MetadataEvent? = note.event as MetadataEvent?
fun getUserMetadataEvent(): MetadataEvent? = note.event as? MetadataEvent
suspend fun sendNewUserMetadata(
name: String? = null,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.bookmarks.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileBookmarksFeedViewModel(
val user: User,
val account: Account,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.conversations.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileConversationsFeedViewModel(
val user: User,
val account: Account,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.followers.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.UserFeedViewModel
@Stable
class UserProfileFollowersUserFeedViewModel(
val user: User,
val account: Account,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.follows.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.UserFeedViewModel
@Stable
class UserProfileFollowsUserFeedViewModel(
val user: User,
val account: Account,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.gallery.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileGalleryFeedViewModel(
val user: User,
val account: Account,
@@ -20,11 +20,13 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.header.apps
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserAppRecommendationsFeedViewModel(
val user: User,
) : AndroidFeedViewModel(UserProfileAppRecommendationsFeedFilter(user)) {
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.mutual.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileMutualFeedViewModel(
val user: User,
val account: Account,
@@ -20,12 +20,14 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.newthreads.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileNewThreadsFeedViewModel(
val user: User,
val account: Account,
@@ -20,11 +20,13 @@
*/
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.reports.dal
import androidx.compose.runtime.Stable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel
@Stable
class UserProfileReportFeedViewModel(
val user: User,
) : AndroidFeedViewModel(UserProfileReportsFeedFilter(user)) {