Bug 1202402 - Nothing shown on the standalone UI when a peer exits the room [r=Standard8]

This commit is contained in:
Ed Lee 2015-09-07 14:20:58 -07:00
Родитель b29ea5a326
Коммит a638bd8659
5 изменённых файлов: 22 добавлений и 10 удалений

Просмотреть файл

@ -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"),

Просмотреть файл

@ -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 (
<div className="room-inner-info-area">
<p className="empty-room-message">
{mozL10n.get("rooms_only_occupant_label")}
{mozL10n.get("rooms_only_occupant_label2")}
</p>
<p className="room-waiting-area">
{mozL10n.get("rooms_read_while_wait_offer")}

Просмотреть файл

@ -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

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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