Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh theme cookie expiration date #2193

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions server/fishtest/static/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ function formatBytes(bytes) {
}

function handleApplicationThemes() {
if (!getCookie("theme")) {
setTheme(mediaTheme());
}
setTheme(getCookie("theme") ?? mediaTheme());
Copy link
Contributor

@peregrineshahin peregrineshahin Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passes false in case the left side is false, which the function doesn't handle obviously because it only checks for dark and consider anything else as light, you need to make a separate refresh function to call in the else part of the original code if statement, looks so wrong and bugged.


try {
window
Expand Down
9 changes: 0 additions & 9 deletions server/fishtest/templates/base.mak
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@
crossorigin="anonymous"
>

% if request.cookies.get('theme') == 'dark':
<link
rel="stylesheet"
href="/css/theme.dark.css?v=${cache_busters['css/theme.dark.css']}"
integrity="sha384-${cache_busters['css/theme.dark.css']}"
crossorigin="anonymous"
>
% endif

<script
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js"
integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg=="
Expand Down
Loading