diff --git a/browser/components/loop/standalone/content/js/standaloneRoomViews.js b/browser/components/loop/standalone/content/js/standaloneRoomViews.js index 880558a81bd6..15d9b9c0f138 100644 --- a/browser/components/loop/standalone/content/js/standaloneRoomViews.js +++ b/browser/components/loop/standalone/content/js/standaloneRoomViews.js @@ -119,9 +119,10 @@ loop.standaloneRoomViews = (function(mozL10n) { }, componentDidUpdate: function() { - // Start a timer once from the earliest waiting state if we need to wait - // before showing a message. - if (this.props.roomState === ROOM_STATES.JOINING && + // Start a timer once from the earliest waiting state or from the state + // after someone else leaves if we need to wait before showing a message. + if ((this.props.roomState === ROOM_STATES.JOINING || + this.props.roomState === ROOM_STATES.SESSION_CONNECTED) && this.state.waitToRenderWaiting && this._waitTimer === undefined) { this._waitTimer = setTimeout(this._allowRenderWaiting, @@ -229,7 +230,7 @@ loop.standaloneRoomViews = (function(mozL10n) { return ( React.createElement("div", {className: "room-inner-info-area"}, React.createElement("p", {className: "empty-room-message"}, - mozL10n.get("rooms_only_occupant_label") + mozL10n.get("rooms_only_occupant_label2") ), React.createElement("p", {className: "room-waiting-area"}, mozL10n.get("rooms_read_while_wait_offer"), diff --git a/browser/components/loop/standalone/content/js/standaloneRoomViews.jsx b/browser/components/loop/standalone/content/js/standaloneRoomViews.jsx index 20b7b9ab22d7..6ebf6980dd5b 100644 --- a/browser/components/loop/standalone/content/js/standaloneRoomViews.jsx +++ b/browser/components/loop/standalone/content/js/standaloneRoomViews.jsx @@ -119,9 +119,10 @@ loop.standaloneRoomViews = (function(mozL10n) { }, componentDidUpdate: function() { - // Start a timer once from the earliest waiting state if we need to wait - // before showing a message. - if (this.props.roomState === ROOM_STATES.JOINING && + // Start a timer once from the earliest waiting state or from the state + // after someone else leaves if we need to wait before showing a message. + if ((this.props.roomState === ROOM_STATES.JOINING || + this.props.roomState === ROOM_STATES.SESSION_CONNECTED) && this.state.waitToRenderWaiting && this._waitTimer === undefined) { this._waitTimer = setTimeout(this._allowRenderWaiting, @@ -229,7 +230,7 @@ loop.standaloneRoomViews = (function(mozL10n) { return (

- {mozL10n.get("rooms_only_occupant_label")} + {mozL10n.get("rooms_only_occupant_label2")}

{mozL10n.get("rooms_read_while_wait_offer")} diff --git a/browser/components/loop/standalone/content/l10n/en-US/loop.properties b/browser/components/loop/standalone/content/l10n/en-US/loop.properties index b0f9933d3e93..0f44ccaec1b4 100644 --- a/browser/components/loop/standalone/content/l10n/en-US/loop.properties +++ b/browser/components/loop/standalone/content/l10n/en-US/loop.properties @@ -97,7 +97,7 @@ rooms_list_copy_url_tooltip=Copy Link rooms_list_delete_tooltip=Delete conversation rooms_list_deleteConfirmation_label=Are you sure? rooms_new_room_button_label=Start a conversation -rooms_only_occupant_label=You're the first one here. +rooms_only_occupant_label2=You're the only one here. rooms_panel_title=Choose a conversation or start a new one rooms_room_full_label=There are already two people in this conversation. rooms_room_full_call_to_action_nonFx_label=Download {{brandShortname}} to start your own diff --git a/browser/components/loop/test/standalone/standaloneRoomViews_test.js b/browser/components/loop/test/standalone/standaloneRoomViews_test.js index ef4091f5768d..f4714fe73bd2 100644 --- a/browser/components/loop/test/standalone/standaloneRoomViews_test.js +++ b/browser/components/loop/test/standalone/standaloneRoomViews_test.js @@ -209,6 +209,17 @@ describe("loop.standaloneRoomViews", function() { sinon.assert.notCalled(dispatch); }); + + it("should dispatch a `TileShown` action after a wait when a participant leaves", + function() { + activeRoomStore.setStoreState({roomState: ROOM_STATES.HAS_PARTICIPANTS}); + clock.tick(loop.standaloneRoomViews.StandaloneRoomInfoArea.RENDER_WAITING_DELAY); + activeRoomStore.remotePeerDisconnected(); + clock.tick(loop.standaloneRoomViews.StandaloneRoomInfoArea.RENDER_WAITING_DELAY); + + sinon.assert.calledOnce(dispatch); + sinon.assert.calledWithExactly(dispatch, new sharedActions.TileShown()); + }); }); describe("#componentWillReceiveProps", function() { diff --git a/browser/locales/en-US/chrome/browser/loop/loop.properties b/browser/locales/en-US/chrome/browser/loop/loop.properties index fa6ea142a557..d52f185a5ae9 100644 --- a/browser/locales/en-US/chrome/browser/loop/loop.properties +++ b/browser/locales/en-US/chrome/browser/loop/loop.properties @@ -324,7 +324,6 @@ rooms_list_delete_tooltip=Delete conversation rooms_list_deleteConfirmation_label=Are you sure? rooms_change_failed_label=Conversation cannot be updated rooms_new_room_button_label=Start a conversation -rooms_only_occupant_label=You're the first one here. rooms_panel_title=Choose a conversation or start a new one rooms_room_full_label=There are already two people in this conversation. rooms_room_full_call_to_action_nonFx_label=Download {{brandShortname}} to start your own