Files
Daniel Espino García b1e4403768 Fix several issues around team join (#6863)
* Fix several issues around team join

* Open in modal and fix channel list

* Add joining states and fix issues

* i18n-extract

* add specific message for group related failures on joining teams

* Address feedback

* Address feedback

* Use error from server response
2022-12-23 14:43:59 +02:00

25 lines
919 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import withObservables from '@nozbe/with-observables';
import {withServerUrl} from '@context/server';
import EphemeralStore from '@store/ephemeral_store';
import TeamSidebar from './team_sidebar';
const enhanced = withObservables([], ({serverUrl}: {serverUrl: string}) => {
// TODO https://mattermost.atlassian.net/browse/MM-43622
// const canCreateTeams = observeCurrentUser(database).pipe(
// switchMap((u) => (u ? of$(u.roles.split(' ')) : of$([]))),
// switchMap((values) => queryRolesByNames(database, values).observe()),
// switchMap((r) => of$(hasPermission(r, Permissions.CREATE_TEAM, false))),
// );
return {
canJoinOtherTeams: EphemeralStore.observeCanJoinOtherTeams(serverUrl),
};
});
export default withServerUrl(enhanced(TeamSidebar));