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 {
{x.title}
+
{x.title}
diff --git a/webclient/src/Results.js b/webclient/src/Results.js
index 4b263d7..3e9d648 100644
--- a/webclient/src/Results.js
+++ b/webclient/src/Results.js
@@ -59,7 +59,7 @@ class Results extends React.Component {
{x.title}
+
{x.title}
diff --git a/webclient/src/ScrollToTop.js b/webclient/src/ScrollToTop.js
index 5773541..0dade11 100644
--- a/webclient/src/ScrollToTop.js
+++ b/webclient/src/ScrollToTop.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { BrowserRouter as Router, Route, Link, withRouter } from 'react-router-dom';
+import { withRouter } from 'react-router-dom';
class ScrollToTop extends React.Component {
componentDidUpdate(prevProps) {
diff --git a/webclient/src/utils.js b/webclient/src/utils.js
index b63caa1..d2d7dc4 100644
--- a/webclient/src/utils.js
+++ b/webclient/src/utils.js
@@ -31,7 +31,7 @@ export class ToggleDot extends React.Component {