On registering, we showed a spinner, and then another spinner on
top of the spinner, which led to an interesting spinner-in-box
effect.
Suppress the second type of spinner when we know we already have one.
After creating a room, display the activity spinner while we wait
for the room to come down the event stream.
This was the intention before but I can't see how it would have
worked: we were setting the 'joining' flag, but then resetting it
by claiming we were already joined in the view_room dispatch.
* Send 'joining' instead of 'joined' in view_room dispatch, which
will set the corresponding joining flag (ie. to indicate we've
sent a request to join the room). Remove the 'joined' flag.
* Reset 'joining' to false otherwise on a view_room dispatch to
prevent it from leaking between rooms (this may have been the
intention of the `if (payload.joined) newState.joining = false`?
Fixes https://github.com/vector-im/riot-web/issues/4701
I thought about adding separate dispatches to prevent confusion but if anyone adds anything that listens to existing dispatches, they really ought to be grep-ing the world for said dispatch actions.
In order to get ILAG internationalised
Conflicts:
src/components/structures/LoggedInView.js
src/components/structures/MatrixChat.js
src/components/views/dialogs/ChatCreateOrReuseDialog.js
src/components/views/dialogs/SetDisplayNameDialog.js
src/createRoom.js
src/i18n/strings/en_EN.json
This allows for a truely flux-y way of storing the currently viewed room, making some callbacks (like onRoomIdResolved) redundant and making sure that the currently viewed room (ID) is only stored in one place as opposed to the previous many places.
This was required for the `join_room` action which can be dispatched to join the currently viewed room.
Another change was to introduce `LifeCycleStore` which is a start at encorporating state related to the lifecycle of the app into a flux store. Currently it only contains an action which will be dispatched when the sync state has become PREPARED. This was necessary to do a deferred dispatch of `join_room` following the registration of a PWLU (PassWord-Less User).
The following actions are introduced:
- RoomViewStore:
- `view_room`: dispatch to change the currently viewed room ID
- `join_room`: dispatch to join the currently viewed room
- LifecycleStore:
- `do_after_sync_prepared`: dispatch to store an action which will be dispatched when `sync_state` is dispatched with `state = 'PREPARED'`
- MatrixChat:
- `sync_state`: dispatched when the sync state changes. Ideally there'd be a SyncStateStore that emitted an `update` upon receiving this, but for now the `LifecycleStore` will listen for `sync_state` directly.
* Add the 'is_direct' flag to rooms created for DMs
* For invites, look for the DM flag when getting the DM user ID for a room
* When accepting an invite, look for the flag and mark the room as a DM room if appropriate.