-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: refresh method in themeStore #582
Conversation
@peterpeterparker shall I break this in smaller PRs? If yes, any suggestion? |
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.
I don't understand your PR — it doesn't seem to implement the function we discussed. I might be missing something, but is it designed this way because some logic remains in OISY? Is that the idea?
To be clear, this is the feature logic I would have expected: #585
@peterpeterparker Ah! I completely misunderstood then! Yes, the idea was to leave some logic there in OISY, but if that is not the case, for sure let's go with your PR |
As discussed offline, I will close this and continue with the correct implementation in : |
Motivation
We would like to have a
refresh
method in thethemeStore
. It is useful for example, if the theme is changed in the local storage and we need to "refresh" the store: for example, we have the case in OISY where we "set" the theme toSYSTEM
, basically deleting the theme in local storage.Changes
getCurrentTheme
to get the current theme set in the store: this code is already insideinitTheme
, we just separate it to re-use it.setTheme
insideinitialTheme
that is re-using the code of theselect
function.refresh
in combination withgetCurrentTheme
.initTheme
function directly in the initialization of the store, instead of creating a function outside. I think it makes more sense since we do not want a static value when creating this store, but we want to capture the current theme.Screenshots
Added a few tests for
themeStore
andinitThemeStore
.