From c2e9f82cd62eed5f4798b8479c3387494b1d6f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Fri, 19 Nov 2021 13:24:07 +0100 Subject: [PATCH] Improved default theme setting. Pushed version 2.0.1 --- .env | 2 +- CHANGELOG.md | 3 ++- client/.env | 2 +- client/src/App.tsx | 2 +- client/src/store/action-creators/theme.ts | 8 ++++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 4390587..9f1bd80 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ PORT=5005 NODE_ENV=development -VERSION=2.0.0 +VERSION=2.0.1 PASSWORD=flame_password SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f5fc9df..ef1b433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -### v2.0.1 (TBA) +### v2.0.1 (2021-11-19) - Added option to display humidity in the weather widget ([#136](https://github.com/pawelmalak/flame/issues/136)) - Added option to set default theme for all new users ([#165](https://github.com/pawelmalak/flame/issues/165)) - Added option to hide header greetings and date separately ([#200](https://github.com/pawelmalak/flame/issues/200)) +- Fixed bug with broken basic auth ([#202](https://github.com/pawelmalak/flame/issues/202)) - Fixed bug with custom icons not working with apps when "pin by default" was disabled ### v2.0.0 (2021-11-15) diff --git a/client/.env b/client/.env index 6a5c8f3..aac1ed1 100644 --- a/client/.env +++ b/client/.env @@ -1 +1 @@ -REACT_APP_VERSION=2.0.0 \ No newline at end of file +REACT_APP_VERSION=2.0.1 \ No newline at end of file diff --git a/client/src/App.tsx b/client/src/App.tsx index d9e8717..68faaea 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -68,7 +68,7 @@ export const App = (): JSX.Element => { // If there is no user theme, set the default one useEffect(() => { if (!loading && !localStorage.theme) { - setTheme(config.defaultTheme); + setTheme(config.defaultTheme, false); } }, [loading]); diff --git a/client/src/store/action-creators/theme.ts b/client/src/store/action-creators/theme.ts index 6209523..8eb6fef 100644 --- a/client/src/store/action-creators/theme.ts +++ b/client/src/store/action-creators/theme.ts @@ -5,11 +5,15 @@ import { Theme } from '../../interfaces/Theme'; import { themes } from '../../components/Settings/Themer/themes.json'; export const setTheme = - (name: string) => (dispatch: Dispatch) => { + (name: string, remeberTheme: boolean = true) => + (dispatch: Dispatch) => { const theme = themes.find((theme) => theme.name === name); if (theme) { - localStorage.setItem('theme', name); + if (remeberTheme) { + localStorage.setItem('theme', name); + } + loadTheme(theme); dispatch({