-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[21.01] Fix setCurrentHistoryId in legacy history panel context #11369
[21.01] Fix setCurrentHistoryId in legacy history panel context #11369
Conversation
If we create a new history in the legacy history the store does not get updated, so https://github.com/galaxyproject/galaxy/blame/3f47effa087f4049132da65643396d58a2be51d1/client/src/components/History/model/historyStore.js#L48 will always return the most recently used history. This is a little silly in that we will load the history twice, but we don't switch the history so often that it should matter.
Looks good to me, but let me check it out and play with a bit, see if I can find any hassles. |
This looks good, but I think we also want to remove the conditional gate in syncVuexToGalaxy because you will want the store monitor to work regardless of whether the beta panel is open or not, now that we are using the history store (via UserHistories) outside of the beta panel.. |
But I think that works correctly, if the beta history panel is open it sets the history on switch, and if it's not open it passes through the dispatch. I don't think there's another possibility ? |
Well what if something elsewhere in the legacy code accesses Galaxy.currentHistory to change the current history from outside of the beta panel interface? I thought that was your use case? If no such UI element exists, disregard my comment. :) |
Yeah, that's just what this fixes, except that switching histories in this legacy view also reloads the whole history panel, so it also worked without this fix. Switching the history even from legacy components nicely passes through the listener you wrote. |
I'm sold. |
If we create a new history in the legacy history the store does not get
updated, so
https://github.com/galaxyproject/galaxy/blame/3f47effa087f4049132da65643396d58a2be51d1/client/src/components/History/model/historyStore.js#L48
will always return the most recently used history.
This is a little silly in that we will load the history twice, but we
don't switch the history so often that it should matter.
If you want to test this, open the upload modal, close it, and switch to a new history, then upload a file. The dataset will appear in the old history. This fixes that.