Skip to content

Commit 6efce52

Browse files
authored
fix yellowbox going from thread back to inbox (keybase#23449)
1 parent 6e63d7b commit 6efce52

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎shared/chat/conversation/list-area/index.native.tsx‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ const Sent = React.memo(({children, conversationIDKey, ordinal}: SentProps) => {
9898
let markedInitiallyLoaded = false
9999

100100
class ConversationList extends React.PureComponent<Props> {
101+
private mounted = true
102+
componentWillUnmount() {
103+
this.mounted = false
104+
}
101105
componentDidMount() {
102106
if (markedInitiallyLoaded) {
103107
return
@@ -175,8 +179,14 @@ class ConversationList extends React.PureComponent<Props> {
175179
return -1
176180
}
177181

178-
private getItemCount = (messageOrdinals: Array<Types.Ordinal>) =>
179-
messageOrdinals ? messageOrdinals.length + 2 : 2
182+
private getItemCount = (messageOrdinals: Array<Types.Ordinal>) => {
183+
if (this.mounted) {
184+
return messageOrdinals ? messageOrdinals.length + 2 : 2
185+
} else {
186+
// needed else VirtualizedList will yellowbox
187+
return 0
188+
}
189+
}
180190

181191
private keyExtractor = (item: ItemType) => {
182192
if (item === 'specialTop') {

0 commit comments

Comments
 (0)