diff --git a/public/js/account.js b/public/js/account.js index af3d408cb..1877bfb16 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -265,6 +265,9 @@ firebase.auth().onAuthStateChanged(function (user) { // showNotification('Signed in', 1000); $(".pageLogin .preloader").addClass("hidden"); $("#menu .icon-button.account .text").text(displayName); + + showFavouriteThemesAtTheTop(); + if (verifyUserWhenLoggedIn !== null) { showNotification("Verifying", 1000); verifyUserWhenLoggedIn.uid = user.uid; diff --git a/public/js/commandline.js b/public/js/commandline.js index d40b2174c..902360d9d 100644 --- a/public/js/commandline.js +++ b/public/js/commandline.js @@ -1456,6 +1456,39 @@ getThemesList().then((themes) => { }); }); +function showFavouriteThemesAtTheTop() { + if (config.favThemes.length > 0) { + commandsThemes.list = []; + config.favThemes.forEach((theme) => { + commandsThemes.list.push({ + id: "changeTheme" + capitalizeFirstLetter(theme), + display: theme.replace(/_/g, " "), + hover: () => { + previewTheme(theme); + }, + exec: () => { + setTheme(theme); + }, + }); + }); + getThemesList().then((themes) => { + themes.forEach((theme) => { + if (config.favThemes.includes(theme.name)) return; + commandsThemes.list.push({ + id: "changeTheme" + capitalizeFirstLetter(theme.name), + display: theme.name.replace(/_/g, " "), + hover: () => { + previewTheme(theme.name); + }, + exec: () => { + setTheme(theme.name); + }, + }); + }); + }); + } +} + let commandsFonts = { title: "Change font...", list: [], diff --git a/public/js/settings.js b/public/js/settings.js index eba9b2036..00150aec2 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -534,6 +534,7 @@ function toggleFavouriteTheme(themename) { } saveConfigToCookie(); refreshThemeButtons(); + showFavouriteThemesAtTheTop(); } function showAccountSettingsSection() {