-
Notifications
You must be signed in to change notification settings - Fork 414
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
Add last used collection to right click menu. #7491
Conversation
Nice. |
Thank you @jessopb I have sent a few changes for that. |
Hm, Can you just switch the recent claim in |
@jessopb I just tested updating the last used collection by only using |
If lastUsed is just the uuid localId of the local collection, or the claimId of the published collection, then you can use a selector Does this make sense, or am I missing something? What part wasn't working? |
Thank you @jessopb you were right, it's much cleaner now! |
ui/redux/reducers/collections.js
Outdated
if (lastUsedCollection) { | ||
newLastUsedCollection = newAllCollections.find((collection) => { | ||
// $FlowFixMe | ||
return collection.name === lastUsedCollection.name; |
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.
We don't have a guarantee that collection.name
is unique.
lbry-desktop/ui/redux/reducers/collections.js
Line 102 in ea7ed53
newPendingList[claimId] = Object.assign({}, newUnpublishedList[localId] || {}); |
Possibly here, we need to carry the old localId:
if (localId) {
// new publish
newPendingList[claimId] = Object.assign({}, newUnpublishedList[localId] || {});
newPendingList[claimId]['previousId'] = localId; // <--------
delete newUnpublishedList[localId];
} else {
Or maybe the collections reducer can keep an object mapping claimIds to localId that can just be looked up. The entry would be deleted after that pending claim is confirmed.
Fixes
Issue Number: #6205
What is the current behavior?
The last used collection is not displayed in the menu options.
What is the new behavior?
The last used collection is displayed in the menu options:
Other information
PR Checklist
Toggle...
What kind of change does this PR introduce?
Please check all that apply to this PR using "x":