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

Properly unmount the bar on mobile app #460

Open
drazik opened this issue Feb 14, 2019 · 1 comment
Open

Properly unmount the bar on mobile app #460

drazik opened this issue Feb 14, 2019 · 1 comment

Comments

@drazik
Copy link
Contributor

drazik commented Feb 14, 2019

On Banks' mobile app, when the user logouts, we have to destroy the cozy-bar. Today, we are doing it by removing the DOM node (https://github.com/cozy/cozy-banks/blob/b794e588cbac644a3275ab28ef92f6ef13eb541b/src/ducks/mobile/utils.js#L12). But since the bar is adding some styles on the body when it's opened, we had to also remove these styles (https://github.com/cozy/cozy-banks/blob/b794e588cbac644a3275ab28ef92f6ef13eb541b/src/ducks/mobile/utils.js#L13).

It seems we should expose an API to just ask to unmount the cozy-bar (like destroy, unmount, whatever) so all these things could be managed properly by the bar. What do you think?

@ptbrowne
Copy link
Contributor

I agree, that it would be cleaner. To go a tiny bit further, I think the cozy-bar should act like a plugin of cozy-client. Links already act a bit like this, especially the cozy-pouch-link, their register method is called on login and their unregister method on logout. It's already a problem for me that the bar is relying on its own token (as the token can go stale etc...(, it should for me rely on the token of cozy-client.

It may be done later, but I think it would be a clean way to kill several birds with one stone.

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

No branches or pull requests

2 participants