Skip to content

Commit a6c59e5

Browse files
committed
Privacy fix
1 parent f65d096 commit a6c59e5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

functions/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,14 @@ const redirects = {
435435

436436
Object.entries(redirects).forEach(([from, to]) => app.get(from, (_, res) => res.redirect(to)))
437437

438-
const pagesWithoutSidebar = ['primary-parallel', 'pmc', 'job-ad', 'tutorinfo']
438+
const pagesWithoutSidebar = ['primary-parallel', 'pmc', 'job-ad', 'tutorinfo', 'privacy-notice']
439+
const pagesWithoutPrivacyModal = ['privacy-notice']
439440

440441
for (let p of ['about', 'introduction', 'parents', 'teachers', 'privacy-notice', 'safeguarding', 'hints-tips', 'job-ad', 'developer-support', 'pmc', 'primary-parallel', 'masterclass', 'troubleshooting', 'tutorinfo', 'academy-primary-parent', 'academy-primary-teacher']) {
441442
const content = fs.readFileSync(path.join(__dirname, `build/${p}.html`));
442443
app.get('/' + p, (_, res) => {
443444
res.locals.sidebarDisabled = pagesWithoutSidebar.includes(p);
445+
res.locals.privacyModalDisabled = pagesWithoutPrivacyModal.includes(p);
444446
res.render('_layout', {content})
445447
});
446448
}

functions/views/_layout.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ html
171171
| and
172172
a(href="https://mathigon.org" target="_blank") #[img(src="/images/mathigon.png" width=16 height=16)] Mathigon
173173

174-
if user && user.privacy && user.privacy.visible
174+
if user && user.privacy && user.privacy.visible && !privacyModalDisabled
175175
iframe(src="/privacy-modal" id="privacy-iframe" style="height: 100%;width: 100%;position: absolute;z-index: 10000000000;top: 0;left: 0;border: none;")
176176

177177
script(defer src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js")

0 commit comments

Comments
 (0)