Revision 6629bac0
Added by Ohad Levy over 6 years ago
webpack/assets/javascripts/react_app/components/notifications/index.js | ||
---|---|---|
import './notifications.scss';
|
||
import ToggleIcon from './toggleIcon/';
|
||
import Drawer from './drawer/';
|
||
import { groupBy, some, isUndefined } from 'lodash';
|
||
import { groupBy, isUndefined } from 'lodash';
|
||
|
||
class notificationContainer extends React.Component {
|
||
componentDidMount() {
|
||
... | ... | |
notifications,
|
||
isDrawerOpen,
|
||
expandedGroup,
|
||
isPolling
|
||
isPolling,
|
||
hasUnreadMessages
|
||
} = state.notifications;
|
||
|
||
return {
|
||
... | ... | |
notifications: groupBy(notifications, 'group'),
|
||
expandedGroup,
|
||
isReady: !isUndefined(notifications),
|
||
hasUnreadMessages: some(notifications, n => !n.seen)
|
||
hasUnreadMessages
|
||
};
|
||
};
|
||
|
Also available in: Unified diff
fixes #20485 - cache notification indicator in local storage
this ensures that the toggle icon is not swapping between
different page loads.
long term maybe we should cache the entire notifications