myxvisual / react-uwp

📱⌨ React Components that Implement Microsoft's UWP Design & Fluent Design.
https://react-uwp.com
MIT License
1.18k stars 78 forks source link

Switching theme failed #51

Open eightHundreds opened 6 years ago

eightHundreds commented 6 years ago

Problem description

<UWPThemeProvider
            theme={getTheme({
              themeName: "light", // set custom theme
              accent: "#0078D7", // set accent color
              useFluentDesign: true, // sure you want use new fluent design.,
              desktopBackgroundImage: BackgroundImg,
            })}
          >
.....

当有背景图,且needGenerateAcrylic为true(默认为true),切换黑白主题时会出错

theme.saveTheme(
                    getTheme({
                      themeName: theme.themeName === "light" ? "dark" : "light",
                      accent: theme.accent,
                      useFluentDesign: theme.useFluentDesign,
                      desktopBackgroundImage: theme.desktopBackgroundImage
                    })
                  )

出问题的代码在这里

cacheDarkAcrylicTextures ,cacheLightAcrylicTextures 总是为undefined,这会导致Object.assign出错