Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update
  • Loading branch information
JamesNK committed Aug 26, 2024
commit 9683cbe307d0d444a1df8f6e90c0110ff2f95860
8 changes: 7 additions & 1 deletion src/Aspire.Dashboard/wwwroot/js/app-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function updateTheme(specifiedTheme) {
* @returns {string}
*/
export function getThemeCookieValue() {
return getCookieValue(currentThemeCookieName) ?? themeSettingSystem;
return getCookieValue(currentThemeCookieName);
}

export function getCurrentTheme() {
Expand Down Expand Up @@ -263,6 +263,12 @@ function initializeTheme() {
const effectiveTheme = getEffectiveTheme(themeCookieValue);

applyTheme(effectiveTheme);

// If a theme cookie has been set then set it again on page load.
// This updates the cookie expiration date and creates a sliding expiration.
if (themeCookieValue) {
setThemeCookie(themeCookieValue);
}
}

createAdditionalDesignTokens();
Expand Down