Skip to content

Commit

Permalink
Fix caching error
Browse files Browse the repository at this point in the history
  • Loading branch information
George Stone authored and George Stone committed Sep 10, 2024
1 parent 938ed63 commit 1b902bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function fetchFeed(url) {
return new Promise(async (resolve, reject) => {
let responseText;
try {
let text;
if (!localStorage.getItem(url) || JSON.parse(localStorage.getItem(url)).expire < Date.now()) {
const response = await fetch('https://us-central1-awesomerssfeedreader.cloudfunctions.net/getFeed?url=' + url);
responseText = await response.text();
Expand All @@ -58,7 +57,7 @@ function fetchFeed(url) {
}
localStorage.setItem(url, JSON.stringify({
expire: Date.now() + 30 * 60 * 1000,
data: text
data: responseText
}))
} else {
const data = localStorage.getItem(url);
Expand Down

0 comments on commit 1b902bd

Please sign in to comment.