Fix cache load race condition bug

This commit is contained in:
Tanner
2020-01-28 04:20:48 +00:00
parent 4773f9766f
commit 7719acee01
+2
View File
@@ -24,8 +24,10 @@ class Article extends React.Component {
localForage.getItem(id) localForage.getItem(id)
.then( .then(
(value) => { (value) => {
if (value) {
this.setState({ story: value }); this.setState({ story: value });
} }
}
); );
fetch('/api/' + id) fetch('/api/' + id)