This repository was archived by the owner on Oct 11, 2022. It is now read-only.
File tree 5 files changed +25
-15
lines changed
5 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -35,22 +35,24 @@ export default async (
35
35
36
36
const { communitySlug, channelSlug, token } = input ;
37
37
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 ) ;
45
39
46
40
if ( ! channel ) return new UserError ( 'No channel found in this community' ) ;
47
41
48
- const settings = await getChannelSettings ( channel . id ) ;
49
-
50
42
if ( ! channel . isPrivate ) {
51
43
return channel ;
52
44
}
53
45
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
+
54
56
if (
55
57
channelPermissions . isOwner ||
56
58
channelPermissions . isModerator ||
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " Spectrum" ,
3
- "version" : " 2.1.10 " ,
3
+ "version" : " 2.1.11 " ,
4
4
"private" : true ,
5
5
"devDependencies" : {
6
6
"babel-cli" : " ^6.24.1" ,
Original file line number Diff line number Diff line change
1
+ // @flow
1
2
import React from 'react' ;
2
- // $FlowFixMe
3
3
import { ActorPhotosContainer , ActorPhotoItem } from '../style' ;
4
4
import Avatar from '../../../components/avatar' ;
5
5
6
- export const ActorsRow = ( { actors } ) => {
6
+ export const ActorsRow = ( { actors } : { actors : Array < Object > } ) => {
7
+ if ( ! actors || actors . length === 0 ) return null ;
8
+
7
9
return (
8
10
< ActorPhotosContainer >
9
11
{ actors . map ( actor => {
10
12
return (
11
13
< ActorPhotoItem key = { actor . id } >
12
14
< Avatar
13
15
user = { actor }
14
- size = { 32 }
15
- radius = { 32 }
16
+ size = { '32' }
17
+ radius = { '32' }
16
18
isOnline = { actor . isOnline }
17
19
src = { actor . profilePhoto }
18
20
link = { actor . username ? `/users/${ actor . username } ` : null }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
21
21
} from '../../../components/threadFeedCard/style' ;
22
22
import compose from 'recompose/compose' ;
23
23
import markSingleNotificationSeenMutation from 'shared/graphql/mutations/notification/markSingleNotificationSeen' ;
24
+ import { DEFAULT_DEPRECATION_REASON } from 'graphql' ;
24
25
25
26
type Props = {
26
27
notification : Object ,
@@ -37,6 +38,9 @@ export class NewUserInCommunityNotification extends React.Component<Props> {
37
38
const date = parseNotificationDate ( notification . modifiedAt ) ;
38
39
const context = parseContext ( notification . context ) ;
39
40
41
+ if ( ! actors . asString || ! actors . asObjects || actors . asObjects . length === 0 )
42
+ return null ;
43
+
40
44
return (
41
45
< NotificationCard >
42
46
< CardLink to = { `/${ notification . context . payload . slug } ` } />
@@ -80,6 +84,9 @@ class MiniNewUserInCommunityNotificationWithMutation extends React.Component<
80
84
const date = parseNotificationDate ( notification . modifiedAt ) ;
81
85
const context = parseContext ( notification . context ) ;
82
86
87
+ if ( ! actors . asString || ! actors . asObjects || actors . asObjects . length === 0 )
88
+ return null ;
89
+
83
90
return (
84
91
< NotificationListRow
85
92
isSeen = { notification . isSeen }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- // $FlowFixMe
3
2
import Link from 'src/components/link' ;
4
3
import { timeDifferenceShort } from '../../helpers/utils' ;
5
4
import { Timestamp } from './style' ;
You can’t perform that action at this time.
0 commit comments