Get rid of lint warnings

This commit is contained in:
2019-10-22 07:31:59 +00:00
parent 9e55f6e4ec
commit 4cf97304e4
6 changed files with 9 additions and 10 deletions

View File

@@ -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;