- Issue created by @nJim
- Merge request !304Issue #3387653: Config-import does not change theme to dark mode as value is set in localStorage β (Merged) created by nJim
- First commit to issue fork.
- Status changed to Needs work
about 1 year ago 10:30am 17 September 2023 - π¨πSwitzerland saschaeggi Zurich
@njlim something is strange with this MR, I can't push a change.
Can you cherry-pick your change to the correct branch
3387653-config-import-does-not
and open a new MR there?diff --git a/js/init.js b/js/init.js index 390c9cee..860de79c 100644 --- a/js/init.js +++ b/js/init.js @@ -32,13 +32,12 @@ function ginInitDarkmode() { ginInitDarkmode(); -// GinDarkMode is not set yet. +// GinDarkMode is not set yet or config changes detected. window.addEventListener('DOMContentLoaded', () => { - if (!localStorage.getItem('Drupal.gin.darkmode')) { - localStorage.setItem('Drupal.gin.darkmode', drupalSettings.gin.darkmode); - ginInitDarkmode(); - } - else if (drupalSettings.gin.darkmode != localStorage.getItem('Drupal.gin.darkmode') && !drupalSettings.gin.show_user_theme_settings) { + if ( + !localStorage.getItem('Drupal.gin.darkmode') || + (drupalSettings.gin.darkmode != localStorage.getItem('Drupal.gin.darkmode') && !drupalSettings.gin.show_user_theme_settings) + ) { localStorage.setItem('Drupal.gin.darkmode', drupalSettings.gin.darkmode); ginInitDarkmode(); }
And apply this diff.
Thank you!
- Status changed to Closed: outdated
11 months ago 8:37am 10 January 2024 - π¨πSwitzerland saschaeggi Zurich
Closing because of the lack of activity. Feel free to reopen if we still need to work on this.
- Status changed to Active
7 months ago 11:31am 26 April 2024 - π©πͺGermany jurgenhaas Gottmadingen
I'm seeing the same issue and I'm happy to test and provide feedback. Just wondering: do I need the changes from the MR and the changes from #4? If so, I'm happy to prepare that in an MR so that we can follow-up from there.
- Issue was unassigned.
- π©πͺGermany jurgenhaas Gottmadingen
I figured it out, I adjusted the MR with the changes from #4 and can confirm that this fixes the issue.
Committing to the MR was possible after I clicked on "Get push access" here in the issue and I also had to accept, that the commit goes to the default branch in the fork.
I'll have to do some more tests, then I can set this to NR.
- Status changed to Needs review
7 months ago 2:05pm 26 April 2024 - π©πͺGermany jurgenhaas Gottmadingen
I've now rebased the MR to the latest dev release and tested the solution successfully.
The main issue with the patch has been, that the file
/dist/js/init.js
contains trailing white space. When loading the patch into an IDE and saving it for local usage, that trailing space gets removed, and suddenly the patch no longer applies. That's probably a separate issue, but I'd suggest to clean up the code base such that trailing spaces get removed completely. -
saschaeggi β
committed c32c1442 on 8.x-3.x authored by
nJim β
Issue #3387653: Config-import does not change theme to dark mode as...
-
saschaeggi β
committed c32c1442 on 8.x-3.x authored by
nJim β
- Status changed to Fixed
7 months ago 8:50am 10 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.