Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Aug 23, 2023
1 parent 99fb570 commit 3666ca1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions blocks/schedule/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async function renderSchedule(block, activeDay, forceReload) {

/**
* Enabled an auto-refresh of the schedule data once each minute (if fullscreen mode is active).
* @param {Element} block
* @param {Element} block
*/
function enableAutoRefresh(block) {
window.setInterval(() => {
Expand All @@ -197,7 +197,6 @@ function enableAutoRefresh(block) {
* @param {Element} block
*/
export default async function decorate(block) {

// detect active day
let activeDay = getActiveDayFromHash();
if (!activeDay) {
Expand Down
17 changes: 8 additions & 9 deletions scripts/utils/fetch.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/**
* Returns Fetch API cache options that force a reload.
* @returns Force reload cache options.
*/
export function getFetchCacheOptionsForceReload() {
return { cache: 'reload' };
}

/**
* Detects the navigation type of the current page in browser.
* If the current page was reloaded (e.g. by user), force a cache reload of items
* fetched via Fetch API as well (e.g. footer, header, Query Index).
* @returns Options for Fetch API.
*/
// eslint-disable-next-line import/prefer-default-export
export function getFetchCacheOptions() {
const navigationType = window.performance.getEntriesByType('navigation')[0]?.type;
if (navigationType === 'reload') {
return getFetchCacheOptionsForceReload();
}
return {};
}

/**
* Returns Fetch API cache options that force a reload.
* @returns Force reload cache options.
*/
export function getFetchCacheOptionsForceReload() {
return { cache: 'reload' };
}
1 change: 1 addition & 0 deletions scripts/utils/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getMetadata } from '../lib-franklin.js';
* Checks fullscreen mode.
* @returns true if fullscreen template is set.
*/
// eslint-disable-next-line import/prefer-default-export
export function isFullscreen() {
return getMetadata('template') === 'fullscreen';
}

0 comments on commit 3666ca1

Please sign in to comment.