diff options
author | Nolan Lawson <nolan@nolanlawson.com> | 2017-06-17 17:57:41 -0700 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-18 02:57:41 +0200 |
commit | 1d9f9352a66e24f21efef4e61fa4f997219bbea3 (patch) | |
tree | c8ed5359931e6175ce11f4a7679921bddff6f87e /app | |
parent | 53e42bf91ef2c705168f8d04b9374c349ec14074 (diff) |
handle resize in a debounce() (#3834)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/features/ui/index.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index fe775b434..9f31b5443 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -13,8 +13,6 @@ import { refreshNotifications } from '../../actions/notifications'; import UploadArea from './components/upload_area'; import ColumnsAreaContainer from './containers/columns_area_container'; -const noOp = () => false; - class UI extends React.PureComponent { static propTypes = { @@ -27,9 +25,11 @@ class UI extends React.PureComponent { draggingOver: false, }; - handleResize = () => { + handleResize = debounce(() => { this.setState({ width: window.innerWidth }); - } + }, 500, { + trailing: true, + }); handleDragEnter = (e) => { e.preventDefault(); |