Skip to content
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

Update current theme after loadThemes call is done #4685

Merged

Conversation

pfirpfel
Copy link
Contributor

Currently, the updateCurrentTheme_ call happens before the loadThemes call. This is problematic if you log in as an user who has a default theme that is non-public. At the time updateCurrentTheme_ gets called, this non-public theme is not available. It will be, after the loadThemes call has finished. That's why updateCurrentTheme_ should happen after loadThemes.

@pfirpfel pfirpfel requested a review from fredj February 26, 2019 08:36
@pfirpfel pfirpfel self-assigned this Feb 26, 2019
Co-Authored-By: pfirpfel <michaelkuenzli@gmail.com>
@pfirpfel pfirpfel force-pushed the 2.2-switch-to-default-non-public-theme branch from 6faf3de to 47910ed Compare February 26, 2019 08:59
@sbrunner
Copy link
Member

@fredj Do you know why we have this
if (evt.type !== gmf.AuthenticationEventType.READY) {

@pfirpfel
Copy link
Contributor Author

@fredj Do you know why we have this
if (evt.type !== gmf.AuthenticationEventType.READY) {

One reason I see, is that every login and logout produces a second call with gmf.AuthenticationEventType.READY.

May be we can remove this if clause and change the listener to listenOnce below:

ol.events.listenOnce(gmfAuthentication, gmf.AuthenticationEventType.READY, userChange);

@pfirpfel pfirpfel changed the title Update current theme after loadThemes call is done [2.2] Update current theme after loadThemes call is done Feb 26, 2019
@pfirpfel pfirpfel merged commit 530e577 into camptocamp:2.2 Feb 28, 2019
@pfirpfel pfirpfel deleted the 2.2-switch-to-default-non-public-theme branch February 28, 2019 14:57
@sbrunner sbrunner added this to the 2.2 milestone Feb 28, 2019
@sbrunner sbrunner changed the title [2.2] Update current theme after loadThemes call is done Update current theme after loadThemes call is done Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants