瀏覽代碼

Improved default theme setting. Pushed version 2.0.1

Paweł Malak 3 年之前
父節點
當前提交
c2e9f82cd6
共有 5 個文件被更改,包括 11 次插入6 次删除
  1. 1 1
      .env
  2. 2 1
      CHANGELOG.md
  3. 1 1
      client/.env
  4. 1 1
      client/src/App.tsx
  5. 6 2
      client/src/store/action-creators/theme.ts

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 PORT=5005
 NODE_ENV=development
-VERSION=2.0.0
+VERSION=2.0.1
 PASSWORD=flame_password
 SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b

+ 2 - 1
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)

+ 1 - 1
client/.env

@@ -1 +1 @@
-REACT_APP_VERSION=2.0.0
+REACT_APP_VERSION=2.0.1

+ 1 - 1
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]);
 

+ 6 - 2
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<SetThemeAction>) => {
+  (name: string, remeberTheme: boolean = true) =>
+  (dispatch: Dispatch<SetThemeAction>) => {
     const theme = themes.find((theme) => theme.name === name);
 
     if (theme) {
-      localStorage.setItem('theme', name);
+      if (remeberTheme) {
+        localStorage.setItem('theme', name);
+      }
+
       loadTheme(theme);
 
       dispatch({