Merge pull request #1636 from matrix-org/luke/allow-guest-access-mygroups
Allow guest to see MyGroups, show ILAG when creating a group
This commit is contained in:
commit
6c283e2a0d
2 changed files with 13 additions and 5 deletions
|
@ -81,8 +81,7 @@ const ONBOARDING_FLOW_STARTERS = [
|
||||||
'view_user_settings',
|
'view_user_settings',
|
||||||
'view_create_chat',
|
'view_create_chat',
|
||||||
'view_create_room',
|
'view_create_room',
|
||||||
'view_my_groups',
|
'view_create_group',
|
||||||
'view_group',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
@ -501,6 +500,11 @@ module.exports = React.createClass({
|
||||||
case 'view_create_room':
|
case 'view_create_room':
|
||||||
this._createRoom();
|
this._createRoom();
|
||||||
break;
|
break;
|
||||||
|
case 'view_create_group': {
|
||||||
|
const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog");
|
||||||
|
Modal.createTrackedDialog('Create Community', '', CreateGroupDialog);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'view_room_directory':
|
case 'view_room_directory':
|
||||||
this._setPage(PageTypes.RoomDirectory);
|
this._setPage(PageTypes.RoomDirectory);
|
||||||
this.notifyNewScreen('directory');
|
this.notifyNewScreen('directory');
|
||||||
|
|
|
@ -18,9 +18,9 @@ import React from 'react';
|
||||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
import { _t } from '../../languageHandler';
|
import { _t } from '../../languageHandler';
|
||||||
|
import dis from '../../dispatcher';
|
||||||
import withMatrixClient from '../../wrappers/withMatrixClient';
|
import withMatrixClient from '../../wrappers/withMatrixClient';
|
||||||
import AccessibleButton from '../views/elements/AccessibleButton';
|
import AccessibleButton from '../views/elements/AccessibleButton';
|
||||||
import Modal from '../../Modal';
|
|
||||||
|
|
||||||
export default withMatrixClient(React.createClass({
|
export default withMatrixClient(React.createClass({
|
||||||
displayName: 'MyGroups',
|
displayName: 'MyGroups',
|
||||||
|
@ -41,14 +41,18 @@ export default withMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_onCreateGroupClick: function() {
|
_onCreateGroupClick: function() {
|
||||||
const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog");
|
dis.dispatch({action: 'view_create_group'});
|
||||||
Modal.createTrackedDialog('Create Community', '', CreateGroupDialog);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_fetch: function() {
|
_fetch: function() {
|
||||||
this.props.matrixClient.getJoinedGroups().done((result) => {
|
this.props.matrixClient.getJoinedGroups().done((result) => {
|
||||||
this.setState({groups: result.groups, error: null});
|
this.setState({groups: result.groups, error: null});
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
|
if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') {
|
||||||
|
// Indicate that the guest isn't in any groups (which should be true)
|
||||||
|
this.setState({groups: [], error: null});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setState({groups: null, error: err});
|
this.setState({groups: null, error: err});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue