mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
Merge branch 'main' into claude/relay-auth-cache-91pa8f
This commit is contained in:
@@ -98,7 +98,12 @@ fun RenderChannelInvite(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
) {
|
||||
val workspaces = accountViewModel.account.buzzWorkspaces.flow.value
|
||||
// Collected, not read as .value: the workspace set arrives asynchronously (a 13534 roster landing
|
||||
// after this row is first drawn), and a plain .value read is a one-shot snapshot that never
|
||||
// recomposes — so an invite drawn before its workspace was known would stay blank. This is what
|
||||
// Compose's StateFlowValueCalledInComposition lint flags.
|
||||
val workspaces by accountViewModel.account.buzzWorkspaces.flow
|
||||
.collectAsStateWithLifecycle()
|
||||
val notice = remember(note, workspaces) { note.toMembershipNotice(workspaces) } ?: return
|
||||
// A withdrawn membership is not an invite. The projection already excludes these before a card is
|
||||
// built; re-checked here because this renderer is reachable from any NoteCompose over a 44100.
|
||||
|
||||
+5
-1
@@ -644,7 +644,11 @@ private fun ChannelInviteRoomCompose(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
) {
|
||||
val workspaces = accountViewModel.account.buzzWorkspaces.flow.value
|
||||
// Collected rather than read as .value, for the same reason as RenderChannelInvite: the workspace
|
||||
// set lands asynchronously, and a snapshot read never recomposes, so a row drawn before its
|
||||
// workspace was known would never appear.
|
||||
val workspaces by accountViewModel.account.buzzWorkspaces.flow
|
||||
.collectAsStateWithLifecycle()
|
||||
val notice = remember(inviteNote, workspaces) { inviteNote.toMembershipNotice(workspaces) } ?: return
|
||||
val baseChannel =
|
||||
remember(notice) { LocalCache.getOrCreateRelayGroupChannel(GroupId(notice.channelId, notice.relay)) }
|
||||
|
||||
Reference in New Issue
Block a user