Do some level of local echo for widgets

* Show a spinner while we wait for widgets to be deleted
 * Hide widgets while they're pending deletion
 * Don't put another jitsi widget into the room if there's already
   one pending
This commit is contained in:
David Baker
2018-07-03 11:16:44 +01:00
parent 767e67dc70
commit 8b64ddcbe8
8 changed files with 237 additions and 82 deletions

View File

@@ -183,6 +183,20 @@ function createEventDecryptedAction(matrixClient, event) {
return { action: 'MatrixActions.Event.decrypted', event };
}
/**
* Create a MatrixActions.RoomState.vents action that represents
* a MatrixClient `RoomState.events` matrix event, emitted when the
* state events in a room change.
*
* @param {MatrixClient} matrixClient the matrix client.
* @param {MatrixEvent} event matrix event which caused this event to fire.
* @param {RoomState} state room state whose RoomState.events dictionary was updated.
* @returns {EventDecryptedAction} an action of type `MatrixActions.Event.decrypted`.
*/
function createRoomStateEventsAction(matrixClient, event, state) {
return { action: 'MatrixActions.RoomState.events', event, state };
}
/**
* This object is responsible for dispatching actions when certain events are emitted by
* the given MatrixClient.
@@ -204,6 +218,7 @@ export default {
this._addMatrixClientListener(matrixClient, 'Room.timeline', createRoomTimelineAction);
this._addMatrixClientListener(matrixClient, 'RoomMember.membership', createRoomMembershipAction);
this._addMatrixClientListener(matrixClient, 'Event.decrypted', createEventDecryptedAction);
this._addMatrixClientListener(matrixClient, 'RoomState.events', createRoomStateEventsAction);
},
/**