Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 894140e

Browse files
authored
Merge pull request #2618 from withspectrum/2.1.11
2.1.11
2 parents 4ae7f95 + 93fc13b commit 894140e

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

Diff for: iris/mutations/channel/joinChannelWithToken.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ export default async (
3535

3636
const { communitySlug, channelSlug, token } = input;
3737

38-
const [communityPermissions, channelPermissions, channel] = await Promise.all(
39-
[
40-
getUserPermissionsInCommunity(communitySlug, currentUser.id),
41-
getUserPermissionsInChannel(channelSlug, currentUser.id),
42-
getChannelBySlug(channelSlug, communitySlug),
43-
]
44-
);
38+
const channel = await getChannelBySlug(channelSlug, communitySlug);
4539

4640
if (!channel) return new UserError('No channel found in this community');
4741

48-
const settings = await getChannelSettings(channel.id);
49-
5042
if (!channel.isPrivate) {
5143
return channel;
5244
}
5345

46+
const [
47+
communityPermissions,
48+
channelPermissions,
49+
settings,
50+
] = await Promise.all([
51+
getUserPermissionsInCommunity(channel.communityId, currentUser.id),
52+
getUserPermissionsInChannel(channel.id, currentUser.id),
53+
getChannelSettings(channel.id),
54+
]);
55+
5456
if (
5557
channelPermissions.isOwner ||
5658
channelPermissions.isModerator ||

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.1.10",
3+
"version": "2.1.11",
44
"private": true,
55
"devDependencies": {
66
"babel-cli": "^6.24.1",

Diff for: src/views/notifications/components/actorsRow.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
// @flow
12
import React from 'react';
2-
// $FlowFixMe
33
import { ActorPhotosContainer, ActorPhotoItem } from '../style';
44
import Avatar from '../../../components/avatar';
55

6-
export const ActorsRow = ({ actors }) => {
6+
export const ActorsRow = ({ actors }: { actors: Array<Object> }) => {
7+
if (!actors || actors.length === 0) return null;
8+
79
return (
810
<ActorPhotosContainer>
911
{actors.map(actor => {
1012
return (
1113
<ActorPhotoItem key={actor.id}>
1214
<Avatar
1315
user={actor}
14-
size={32}
15-
radius={32}
16+
size={'32'}
17+
radius={'32'}
1618
isOnline={actor.isOnline}
1719
src={actor.profilePhoto}
1820
link={actor.username ? `/users/${actor.username}` : null}

Diff for: src/views/notifications/components/newUserInCommunityNotification.js

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
} from '../../../components/threadFeedCard/style';
2222
import compose from 'recompose/compose';
2323
import markSingleNotificationSeenMutation from 'shared/graphql/mutations/notification/markSingleNotificationSeen';
24+
import { DEFAULT_DEPRECATION_REASON } from 'graphql';
2425

2526
type Props = {
2627
notification: Object,
@@ -37,6 +38,9 @@ export class NewUserInCommunityNotification extends React.Component<Props> {
3738
const date = parseNotificationDate(notification.modifiedAt);
3839
const context = parseContext(notification.context);
3940

41+
if (!actors.asString || !actors.asObjects || actors.asObjects.length === 0)
42+
return null;
43+
4044
return (
4145
<NotificationCard>
4246
<CardLink to={`/${notification.context.payload.slug}`} />
@@ -80,6 +84,9 @@ class MiniNewUserInCommunityNotificationWithMutation extends React.Component<
8084
const date = parseNotificationDate(notification.modifiedAt);
8185
const context = parseContext(notification.context);
8286

87+
if (!actors.asString || !actors.asObjects || actors.asObjects.length === 0)
88+
return null;
89+
8390
return (
8491
<NotificationListRow
8592
isSeen={notification.isSeen}

Diff for: src/views/notifications/utils.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
// $FlowFixMe
32
import Link from 'src/components/link';
43
import { timeDifferenceShort } from '../../helpers/utils';
54
import { Timestamp } from './style';

0 commit comments

Comments
 (0)