mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Guard against the notification dropdown button missing a function
This commit is contained in:
parent
826ca08073
commit
8927ccb847
@ -11,16 +11,12 @@ import Nav from 'react-bootstrap/lib/Nav';
|
|||||||
import NotificationActions from '../actions/notification_actions';
|
import NotificationActions from '../actions/notification_actions';
|
||||||
import NotificationStore from '../stores/notification_store';
|
import NotificationStore from '../stores/notification_store';
|
||||||
|
|
||||||
import { mergeOptions } from '../utils/general_utils';
|
|
||||||
import { getLangText } from '../utils/lang_utils';
|
import { getLangText } from '../utils/lang_utils';
|
||||||
|
|
||||||
|
|
||||||
let HeaderNotifications = React.createClass({
|
let HeaderNotifications = React.createClass({
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return mergeOptions(
|
return NotificationStore.getState();
|
||||||
NotificationStore.getState()
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -59,7 +55,11 @@ let HeaderNotifications = React.createClass({
|
|||||||
NOW, THAT DIDN'T WORK - the onSelect routine isnt triggered in all cases
|
NOW, THAT DIDN'T WORK - the onSelect routine isnt triggered in all cases
|
||||||
Hence, we do this manually
|
Hence, we do this manually
|
||||||
*/
|
*/
|
||||||
this.refs.dropdownbutton.setDropdownState(false);
|
const { dropdownButton } = this.refs;
|
||||||
|
|
||||||
|
if (dropdownButton && typeof dropdownButton.setDropdownState === 'function') {
|
||||||
|
dropdownbutton.setDropdownState(false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getPieceNotifications() {
|
getPieceNotifications() {
|
||||||
@ -125,7 +125,7 @@ let HeaderNotifications = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Nav navbar right>
|
<Nav navbar right>
|
||||||
<DropdownButton
|
<DropdownButton
|
||||||
ref='dropdownbutton'
|
ref='dropdownButton'
|
||||||
id="header-notification-dropdown"
|
id="header-notification-dropdown"
|
||||||
eventKey="1"
|
eventKey="1"
|
||||||
title={
|
title={
|
||||||
|
Loading…
Reference in New Issue
Block a user