Skip to content

Commit d6f9e76

Browse files
committed
fix flow errors
1 parent 955f263 commit d6f9e76

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/App.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import './App.css';
55
import graphql from 'babel-plugin-relay/macro';
66
import {QueryRenderer, fetchQuery} from 'react-relay';
77
import Posts from './Posts';
8-
import Post, {LoadingPost} from './Post';
8+
import Post from './Post';
99
import {onegraphAuth} from './Environment';
1010
import {Route, Link, Switch} from 'react-router-dom';
1111
import idx from 'idx';
@@ -19,6 +19,7 @@ import UserContext from './UserContext';
1919

2020
import type {App_ViewerQueryResponse} from './__generated__/App_Query.graphql';
2121
import type {Environment} from 'relay-runtime';
22+
import type {RelayNetworkError} from 'react-relay';
2223

2324
const theme = {
2425
global: {
@@ -43,7 +44,9 @@ const postsRootQuery = graphql`
4344
}
4445
`;
4546

46-
const ErrorBox = ({error}) => {
47+
const ErrorBox = ({error}: {error: Error}) => {
48+
console.log('e', error);
49+
// $FlowFixMe
4750
const relayError = idx(error, _ => _.source.errors[0].message);
4851
return (
4952
<Box gap="xsmall" justify="center" align="center" direction="row">

src/Post.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ const Post = ({relay, post}: Props) => {
279279
<TippyGroup delay={500}>
280280
{usedReactions.map(g => {
281281
const total = g.users.totalCount;
282-
const reactors = g.users.nodes.map(x => x.login);
282+
const reactors = (g.users.nodes || []).map(x =>
283+
x ? x.login : null,
284+
);
283285
if (total > 11) {
284286
reactors.push(`${total - 11} more`);
285287
}

0 commit comments

Comments
 (0)