prefer title for collection name on resolve

This commit is contained in:
zeppi 2021-05-13 14:06:45 -04:00
parent 15eebee694
commit 79519a3ea1

View file

@ -40,11 +40,9 @@ export const doLocalCollectionCreate = (
}); });
}; };
export const doCollectionDelete = ( export const doCollectionDelete = (id: string, colKey: ?string = undefined) => (
id: string, dispatch: Dispatch
colKey: ?string = undefined, ) => {
keepLocal?: boolean
) => (dispatch: Dispatch) => {
return dispatch({ return dispatch({
type: ACTIONS.COLLECTION_DELETE, type: ACTIONS.COLLECTION_DELETE,
data: { data: {
@ -219,7 +217,8 @@ export const doFetchItemsInCollections = (
const claim = makeSelectClaimForClaimId(collectionId)(stateAfterClaimSearch); const claim = makeSelectClaimForClaimId(collectionId)(stateAfterClaimSearch);
const editedCollection = makeSelectEditedCollectionForId(collectionId)(stateAfterClaimSearch); const editedCollection = makeSelectEditedCollectionForId(collectionId)(stateAfterClaimSearch);
const { name, timestamp } = claim || {}; const { name, timestamp, value } = claim || {};
const { title } = value;
const valueTypes = new Set(); const valueTypes = new Set();
const streamTypes = new Set(); const streamTypes = new Set();
@ -242,7 +241,7 @@ export const doFetchItemsInCollections = (
newCollectionItemsById[collectionId] = { newCollectionItemsById[collectionId] = {
items, items,
id: collectionId, id: collectionId,
name: name, name: title || name,
itemCount: claim.value.claims.length, itemCount: claim.value.claims.length,
type: isPlaylist ? 'playlist' : 'collection', type: isPlaylist ? 'playlist' : 'collection',
updatedAt: timestamp, updatedAt: timestamp,