New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[system] Fix mode blink when open multiple sessions #33877
[system] Fix mode blink when open multiple sessions #33877
Conversation
…em/fix-css-vars-provider
@@ -611,7 +611,6 @@ describe('createCssVarsProvider', () => { | |||
); | |||
|
|||
expect(screen.getByTestId('current-mode').textContent).to.equal('dark'); | |||
expect(global.localStorage.setItem.calledWith(customModeStorageKey, 'dark')).to.equal(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary because the value is already dark
.
return ( | ||
<CssVarsProvider modeStorageKey="dark-mode-specificity"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to use a custom key because the storage is cleared between tests in test/regressions/index.test.js
…em/fix-css-vars-provider
…em/fix-css-vars-provider
Before
There is a flaw in using
React.useEffect
in the code which causes the mode to switch back and forth between sessions.Screen.Recording.2565-08-15.at.12.47.33.mov
After
Screen.Recording.2565-08-15.at.12.53.10.mov
The tests already covered the common scenarios. This bug is a very edge case due to our documentation requirement.