Bug 1088672 - Part 4. Rewrite Loop's incoming call handling in the flux style. Put back alerts and make window unload be handled correctly. r=mikedeboer

This commit is contained in:
Mark Banner
2015-03-12 14:01:38 +00:00
parent 6d4149d79b
commit 83d1858561
7 changed files with 108 additions and 35 deletions

View File

@@ -147,6 +147,7 @@ loop.conversationViews = (function(mozL10n) {
callType: React.PropTypes.string.isRequired,
callerId: React.PropTypes.string.isRequired,
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired,
// Only for use by the ui-showcase
showMenu: React.PropTypes.bool
},
@@ -157,6 +158,14 @@ loop.conversationViews = (function(mozL10n) {
};
},
componentDidMount: function() {
this.props.mozLoop.startAlerting();
},
componentWillUnmount: function() {
this.props.mozLoop.stopAlerting();
},
clickHandler: function(e) {
var target = e.target;
if (!target.classList.contains('btn-chevron')) {
@@ -939,7 +948,8 @@ loop.conversationViews = (function(mozL10n) {
],
propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired
},
getInitialState: function() {
@@ -989,7 +999,8 @@ loop.conversationViews = (function(mozL10n) {
return (React.createElement(AcceptCallView, {
callType: this.state.callType,
callerId: this.state.callerId,
dispatcher: this.props.dispatcher}
dispatcher: this.props.dispatcher,
mozLoop: this.props.mozLoop}
));
}