diff --git a/browser/components/loop/content/js/conversationViews.js b/browser/components/loop/content/js/conversationViews.js index 3dbc3c272f0..a6e5067a5f0 100644 --- a/browser/components/loop/content/js/conversationViews.js +++ b/browser/components/loop/content/js/conversationViews.js @@ -124,8 +124,6 @@ loop.conversationViews = (function(mozL10n) { render: function() { var contactName = _getContactDisplayName(this.props.contact); - document.title = contactName; - return ( React.createElement("div", {className: "call-window"}, React.createElement(CallIdentifierView, { @@ -966,6 +964,7 @@ loop.conversationViews = (function(mozL10n) { var CallControllerView = React.createClass({displayName: "CallControllerView", mixins: [ sharedMixins.AudioMixin, + sharedMixins.DocumentTitleMixin, loop.store.StoreMixin("conversationStore"), Backbone.Events ], @@ -995,7 +994,7 @@ loop.conversationViews = (function(mozL10n) { * Used to setup and render the feedback view. */ _renderFeedbackView: function() { - document.title = mozL10n.get("conversation_has_ended"); + this.setTitle(mozL10n.get("conversation_has_ended")); return ( React.createElement(sharedViews.FeedbackView, { @@ -1033,6 +1032,14 @@ loop.conversationViews = (function(mozL10n) { }, render: function() { + // Set the default title to the contact name or the callerId, note + // that views may override this, e.g. the feedback view. + if (this.state.contact) { + this.setTitle(_getContactDisplayName(this.state.contact)); + } else { + this.setTitle(this.state.callerId || ""); + } + switch (this.state.callState) { case CALL_STATES.CLOSE: { this._closeWindow(); diff --git a/browser/components/loop/content/js/conversationViews.jsx b/browser/components/loop/content/js/conversationViews.jsx index 77440dd73ee..cf6455e557c 100644 --- a/browser/components/loop/content/js/conversationViews.jsx +++ b/browser/components/loop/content/js/conversationViews.jsx @@ -124,8 +124,6 @@ loop.conversationViews = (function(mozL10n) { render: function() { var contactName = _getContactDisplayName(this.props.contact); - document.title = contactName; - return (