Merge branch 'vector' of github.com:matrix-org/matrix-react-sdk into erikj/room_editing
This commit is contained in:
@@ -97,9 +97,10 @@ require('../skins/base/views/molecules/RoomSettings');
|
||||
require('../skins/base/views/organisms/LeftPanel');
|
||||
require('../skins/base/views/organisms/RightPanel');
|
||||
require('../skins/base/views/organisms/LogoutPrompt');
|
||||
require('../skins/base/views/organisms/RoomDirectory');
|
||||
require('../skins/base/views/molecules/RoomCreate');
|
||||
require('../skins/base/views/molecules/RoomDropTarget');
|
||||
require('../skins/base/views/molecules/DirectoryMenu');
|
||||
require('../skins/base/views/molecules/BottomLeftMenu');
|
||||
require('../skins/base/views/molecules/DateSeparator');
|
||||
require('../skins/base/views/atoms/voip/VideoFeed');
|
||||
require('../skins/base/views/molecules/voip/VideoView');
|
||||
|
||||
@@ -22,6 +22,7 @@ module.exports = {
|
||||
propTypes: {
|
||||
onValueChanged: React.PropTypes.func,
|
||||
initialValue: React.PropTypes.string,
|
||||
label: React.PropTypes.string,
|
||||
placeHolder: React.PropTypes.string,
|
||||
},
|
||||
|
||||
@@ -34,7 +35,8 @@ module.exports = {
|
||||
return {
|
||||
onValueChanged: function() {},
|
||||
initialValue: '',
|
||||
placeHolder: 'Click to set',
|
||||
label: 'Click to set',
|
||||
placeholder: '',
|
||||
};
|
||||
},
|
||||
|
||||
@@ -77,6 +79,7 @@ module.exports = {
|
||||
this.setState({
|
||||
phase: this.Phases.Display,
|
||||
});
|
||||
this.onValueChanged(false);
|
||||
},
|
||||
|
||||
onValueChanged: function(shouldSubmit) {
|
||||
|
||||
@@ -200,7 +200,7 @@ module.exports = {
|
||||
}, function(err) {
|
||||
console.error("Command failure: %s", err);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Server Error",
|
||||
title: "Server error",
|
||||
description: err.message
|
||||
});
|
||||
});
|
||||
@@ -208,7 +208,7 @@ module.exports = {
|
||||
else if (cmd.error) {
|
||||
console.error(cmd.error);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Command Error",
|
||||
title: "Command error",
|
||||
description: cmd.error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ module.exports = {
|
||||
}, function(err) {
|
||||
console.error("Failed to invite: %s", JSON.stringify(err));
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Invite Server Error",
|
||||
title: "Server error whilst inviting",
|
||||
description: err.message
|
||||
});
|
||||
self.setState({
|
||||
|
||||
@@ -33,6 +33,7 @@ module.exports = {
|
||||
RoomView: "room_view",
|
||||
UserSettings: "user_settings",
|
||||
CreateRoom: "create_room",
|
||||
RoomDirectory: "room_directory",
|
||||
},
|
||||
|
||||
AuxPanel: {
|
||||
@@ -43,7 +44,7 @@ module.exports = {
|
||||
return {
|
||||
logged_in: !!(MatrixClientPeg.get() && MatrixClientPeg.get().credentials),
|
||||
ready: false,
|
||||
page_type: this.PageTypes.RoomView,
|
||||
page_type: MatrixClientPeg.get().getRooms().length ? this.PageTypes.RoomView : this.PageTypes.RoomDirectory,
|
||||
aux_panel: null,
|
||||
};
|
||||
},
|
||||
@@ -127,6 +128,7 @@ module.exports = {
|
||||
currentRoom: payload.room_id,
|
||||
page_type: this.PageTypes.RoomView,
|
||||
});
|
||||
this.notifyNewScreen('room/'+payload.room_id);
|
||||
break;
|
||||
case 'view_prev_room':
|
||||
roomIndexDelta = -1;
|
||||
@@ -156,6 +158,11 @@ module.exports = {
|
||||
page_type: this.PageTypes.CreateRoom,
|
||||
});
|
||||
break;
|
||||
case 'view_room_directory':
|
||||
this.setState({
|
||||
page_type: this.PageTypes.RoomDirectory,
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -172,13 +179,18 @@ module.exports = {
|
||||
var cli = MatrixClientPeg.get();
|
||||
var self = this;
|
||||
cli.on('syncComplete', function() {
|
||||
var firstRoom = null;
|
||||
if (cli.getRooms() && cli.getRooms().length) {
|
||||
firstRoom = RoomListSorter.mostRecentActivityFirst(
|
||||
cli.getRooms()
|
||||
)[0].roomId;
|
||||
if (!self.state.currentRoom) {
|
||||
var firstRoom = null;
|
||||
if (cli.getRooms() && cli.getRooms().length) {
|
||||
firstRoom = RoomListSorter.mostRecentActivityFirst(
|
||||
cli.getRooms()
|
||||
)[0].roomId;
|
||||
}
|
||||
self.setState({ready: true, currentRoom: firstRoom});
|
||||
self.notifyNewScreen('room/'+firstRoom);
|
||||
} else {
|
||||
self.setState({ready: true});
|
||||
}
|
||||
self.setState({ready: true, currentRoom: firstRoom});
|
||||
dis.dispatch({action: 'focus_composer'});
|
||||
});
|
||||
cli.on('Call.incoming', function(call) {
|
||||
@@ -222,6 +234,12 @@ module.exports = {
|
||||
action: 'start_login',
|
||||
params: params
|
||||
});
|
||||
} else if (screen.indexOf('room/') == 0) {
|
||||
var roomId = screen.split('/')[1];
|
||||
dis.dispatch({
|
||||
action: 'view_room',
|
||||
room_id: roomId
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user