Skip to content

Commit

Permalink
more again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 29, 2024
1 parent b5b0a2a commit ecf104f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions labapp/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@

// Update the page with cached values if they exist
if (cachedSiteName && cachedState) {
document.getElementById('siteName').textContent = `${cachedSiteName}`;
document.getElementById('siteState').textContent = `${cachedState}`;
document.getElementById('siteName').textContent = cachedSiteName;
document.getElementById('siteState').textContent = cachedState;
} else {
// Fetch from server if no valid cache exists
fetch('/_ce_status')
Expand All @@ -152,8 +152,8 @@
})
.then(data => {
if (!data.err) {
document.getElementById('siteName').textContent = `${cachedSiteName}`;
document.getElementById('siteState').textContent = `${cachedState}`;
document.getElementById('siteName').textContent = cachedSiteName;
document.getElementById('siteState').textContent = cachedState;
// Cache the site name and state in cookies for 1 day
setCookie('siteNameCache', data.site_name, 1);
setCookie('stateCache', data.state, 1);
Expand Down

0 comments on commit ecf104f

Please sign in to comment.