Clear localstorage cache and add slogan

This commit is contained in:
2019-08-25 01:25:28 +00:00
parent 1b6c8fc6cb
commit 2b1a352917
5 changed files with 15 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { sourceLink, infoLine } from './utils.js';
import { clearStorage } from './utils.js';
const apiUrl = 'http://news-api.dns.t0.vc/';
@@ -21,6 +22,7 @@ class Feed extends React.Component {
.then(
(result) => {
this.setState({ stories: result.stories });
clearStorage();
localStorage.setItem('stories', JSON.stringify(result.stories));
result.stories.slice(0, 25).forEach(x => {
fetch(apiUrl + x.id)