Update ui.js to not load home, notifcations on componentWillMount

• Update:
- ui.js to not load home, notifcations on componentWillMount if not on that page

• Todo:
- Fix and expand notifications as expected
This commit is contained in:
mgabdev 2020-05-19 15:49:54 -04:00
parent 535e76a02f
commit 0b88db6204

View File

@ -353,7 +353,7 @@ class UI extends PureComponent {
}
}
componentDidMount() {
componentWillMount() {
if (!me) return
window.addEventListener('beforeunload', this.handleBeforeUnload, false)
@ -372,13 +372,16 @@ class UI extends PureComponent {
window.setTimeout(() => Notification.requestPermission(), 120 * 1000)
}
this.props.dispatch(expandHomeTimeline())
this.props.dispatch(expandNotifications())
this.props.dispatch(initializeNotifications())
if (this.context.router.route.location.pathname === '/home') {
this.props.dispatch(expandHomeTimeline())
} else if (this.context.router.route.location.pathname === '/notifications') {
this.props.dispatch(expandNotifications())
}
setTimeout(() => {
this.props.dispatch(fetchFilters())
}, 500)
this.props.dispatch(initializeNotifications())
}
componentDidMount() {
// this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
// return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName)
// }