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