Skip to content

Commit 91303f1

Browse files
committed
Fix isMine on status (#21)
1 parent bdcbf85 commit 91303f1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • shared/src/commonMain/kotlin/site/remlit/snowdrop/component

shared/src/commonMain/kotlin/site/remlit/snowdrop/component/Status.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fun Status(status: Status) {
104104
var realStatus by remember { mutableStateOf(status) }
105105
var isReblog by remember { mutableStateOf(false) }
106106
var rebloggingAccount by remember { mutableStateOf<Account?>(null) }
107-
var isMine by remember { mutableStateOf(realStatus.account?.id == currentAccount?.id) }
107+
var isMine by remember { mutableStateOf(false) }
108108
//todo: or is admin? figure out how to do that
109109

110110
if (status.reblog != null) {
@@ -113,6 +113,9 @@ fun Status(status: Status) {
113113
rebloggingAccount = status.account
114114
}
115115

116+
if (realStatus.account?.id == currentAccount?.id)
117+
isMine = true
118+
116119
var cwOpen by remember { mutableStateOf(false) }
117120
var showDropdown by remember { mutableStateOf(false) }
118121

@@ -145,7 +148,7 @@ fun Status(status: Status) {
145148
Column(
146149
modifier = Modifier.clickable(
147150
enabled = !inThreadView || (inThreadView && !threadViewMainStatus),
148-
onClick = { navHandler.navigate(ThreadRoute(realStatus.id!!)) }
151+
onClick = { navHandler.navigate(ThreadRoute(realStatus.id)) }
149152
).background(
150153
if (threadViewMainStatus) MaterialTheme.colorScheme.surfaceContainerLow
151154
else Color.Unspecified

0 commit comments

Comments
 (0)