mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 01:14:32 +03:00
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into rxl881/apps
This commit is contained in:
commit
0a1647e5c6
3 changed files with 17 additions and 1 deletions
|
@ -41,7 +41,7 @@ const CATEGORY_ORDER = [
|
|||
];
|
||||
|
||||
// Match for ":wink:" or ascii-style ";-)" provided by emojione
|
||||
const EMOJI_REGEX = new RegExp('(' + asciiRegexp + '|:\\w*:?)', 'g');
|
||||
const EMOJI_REGEX = new RegExp('(' + asciiRegexp + '|:\\w*:?)$', 'g');
|
||||
const EMOJI_SHORTNAMES = Object.keys(EmojiData).map((key) => EmojiData[key]).sort(
|
||||
(a, b) => {
|
||||
if (a.category === b.category) {
|
||||
|
|
|
@ -79,6 +79,12 @@ function createRoom(opts) {
|
|||
const modal = Modal.createDialog(Loader, null, 'mx_Dialog_spinner');
|
||||
|
||||
let roomId;
|
||||
if (opts.andView) {
|
||||
// We will possibly have a successful join, indicate as such
|
||||
dis.dispatch({
|
||||
action: 'will_join',
|
||||
});
|
||||
}
|
||||
return client.createRoom(createOpts).finally(function() {
|
||||
modal.close();
|
||||
}).then(function(res) {
|
||||
|
@ -98,10 +104,16 @@ function createRoom(opts) {
|
|||
action: 'view_room',
|
||||
room_id: roomId,
|
||||
should_peek: false,
|
||||
// Creating a room will have joined us to the room
|
||||
joined: true,
|
||||
});
|
||||
}
|
||||
return roomId;
|
||||
}, function(err) {
|
||||
// We also failed to join the room (this sets joining to false in RoomViewStore)
|
||||
dis.dispatch({
|
||||
action: 'join_room_error',
|
||||
});
|
||||
console.error("Failed to create room " + roomId + " " + err);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: _t("Failure to create room"),
|
||||
|
|
|
@ -141,6 +141,10 @@ class RoomViewStore extends Store {
|
|||
shouldPeek: payload.should_peek === undefined ? true : payload.should_peek,
|
||||
};
|
||||
|
||||
if (payload.joined) {
|
||||
newState.joining = false;
|
||||
}
|
||||
|
||||
// If an event ID wasn't specified, default to the one saved for this room
|
||||
// via update_scroll_state. Assume initialEventPixelOffset should be set.
|
||||
if (!newState.initialEventId) {
|
||||
|
|
Loading…
Reference in a new issue