mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-05 07:35:34 +08:00
fix(invariant): Warnings when trying to settle scroll state after unmount
This commit is contained in:
parent
4621f432b0
commit
1c901e090a
1 changed files with 4 additions and 0 deletions
|
@ -61,6 +61,8 @@ class MessageList extends React.Component
|
|||
@MINIFY_THRESHOLD = 3
|
||||
|
||||
componentDidMount: =>
|
||||
@_mounted = true
|
||||
|
||||
window.addEventListener("resize", @_onResize)
|
||||
@_unsubscribers = []
|
||||
@_unsubscribers.push MessageStore.listen @_onChange
|
||||
|
@ -80,6 +82,7 @@ class MessageList extends React.Component
|
|||
@_prepareContentForDisplay()
|
||||
|
||||
componentWillUnmount: =>
|
||||
@_mounted = false
|
||||
unsubscribe() for unsubscribe in @_unsubscribers
|
||||
@command_unsubscriber.dispose()
|
||||
|
||||
|
@ -210,6 +213,7 @@ class MessageList extends React.Component
|
|||
lastHeight = -1
|
||||
stableCount = 0
|
||||
scrollIfSettled = =>
|
||||
return unless @_mounted
|
||||
messageWrapHeight = messageWrap.getBoundingClientRect().height
|
||||
if messageWrapHeight isnt lastHeight
|
||||
lastHeight = messageWrapHeight
|
||||
|
|
Loading…
Reference in a new issue