diff --git a/webclient/src/Article.js b/webclient/src/Article.js index 109b05b..2e5e376 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -1,5 +1,4 @@ import React from 'react'; -import { Link } from 'react-router-dom'; import { Helmet } from 'react-helmet'; import localForage from 'localforage'; import { sourceLink, infoLine, ToggleDot } from './utils.js'; @@ -8,7 +7,7 @@ class Article extends React.Component { constructor(props) { super(props); - const id = this.props.match.params.id; + const id = this.props.match ? this.props.match.params.id : 'CLOL'; const cache = this.props.cache; if (id in cache) console.log('cache hit'); @@ -20,7 +19,7 @@ class Article extends React.Component { } componentDidMount() { - const id = this.props.match.params.id; + const id = this.props.match ? this.props.match.params.id : 'CLOL'; localForage.getItem(id) .then( @@ -43,7 +42,7 @@ class Article extends React.Component { } render() { - const id = this.props.match.params.id; + const id = this.props.match ? this.props.match.params.id : 'CLOL'; const story = this.state.story; const error = this.state.error; diff --git a/webclient/src/Comments.js b/webclient/src/Comments.js index fb8442d..152585a 100644 --- a/webclient/src/Comments.js +++ b/webclient/src/Comments.js @@ -4,7 +4,7 @@ import { HashLink } from 'react-router-hash-link'; import { Helmet } from 'react-helmet'; import moment from 'moment'; import localForage from 'localforage'; -import { sourceLink, infoLine, ToggleDot } from './utils.js'; +import { infoLine, ToggleDot } from './utils.js'; class Article extends React.Component { constructor(props) { @@ -51,7 +51,7 @@ class Article extends React.Component { displayComment(story, c, level) { return ( -
{c.author === story.author ? '[OP]' : ''} {c.author || '[Deleted]'} diff --git a/webclient/src/Feed.js b/webclient/src/Feed.js index 740fd86..815fea4 100644 --- a/webclient/src/Feed.js +++ b/webclient/src/Feed.js @@ -71,7 +71,7 @@ class Feed extends React.Component {