mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
No longer deconstructing account menu ref if it isn't rendered (#11585)
This commit is contained in:
parent
68c852f7c9
commit
a96af9e5fc
@ -253,12 +253,13 @@ export default class AccountMenu extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setShouldShowScrollButton = () => {
|
setShouldShowScrollButton = () => {
|
||||||
|
if (!this.accountsRef) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { scrollTop, offsetHeight, scrollHeight } = this.accountsRef;
|
const { scrollTop, offsetHeight, scrollHeight } = this.accountsRef;
|
||||||
|
|
||||||
const canScroll = scrollHeight > offsetHeight;
|
const canScroll = scrollHeight > offsetHeight;
|
||||||
|
|
||||||
const atAccountListBottom = scrollTop + offsetHeight >= scrollHeight;
|
const atAccountListBottom = scrollTop + offsetHeight >= scrollHeight;
|
||||||
|
|
||||||
const shouldShowScrollButton = canScroll && !atAccountListBottom;
|
const shouldShowScrollButton = canScroll && !atAccountListBottom;
|
||||||
|
|
||||||
this.setState({ shouldShowScrollButton });
|
this.setState({ shouldShowScrollButton });
|
||||||
|
Loading…
Reference in New Issue
Block a user