From b280d66f5df9fc1a3e24cecc86ffa5c0b244a796 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 28 May 2021 08:37:32 -0400 Subject: [PATCH] return new collection on publish --- dist/bundle.es.js | 7 ++++--- src/redux/actions/claims.js | 4 ++-- src/redux/actions/collections.js | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 94302ca..317ee85 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -4380,7 +4380,7 @@ function doCollectionPublish(options, localId) { })); dispatch(doCheckPendingClaims()); dispatch(doFetchCollectionListMine(1, 10)); - resolve(collectionClaim); + return collectionClaim; } function failure(error) { @@ -4450,7 +4450,7 @@ function doCollectionPublishUpdate(options) { }); dispatch(doCheckPendingClaims()); dispatch(doFetchCollectionListMine(1, 10)); - resolve(collectionClaim); + return collectionClaim; } function failure(error) { @@ -4608,7 +4608,8 @@ const doCollectionDelete = (id, colKey = undefined) => (dispatch, getState) => { collectionKey: colKey } }); - if (claim) { + if (claim && !colKey) { + // could support "abandon, but keep" later const { txid, nout } = claim; return dispatch(doAbandonClaim(txid, nout, collectionDelete)); } diff --git a/src/redux/actions/claims.js b/src/redux/actions/claims.js index 090e15f..410a411 100644 --- a/src/redux/actions/claims.js +++ b/src/redux/actions/claims.js @@ -788,7 +788,7 @@ export function doCollectionPublish( ); dispatch(doCheckPendingClaims()); dispatch(doFetchCollectionListMine(1, 10)); - resolve(collectionClaim); + return collectionClaim; } function failure(error) { @@ -879,7 +879,7 @@ export function doCollectionPublishUpdate(options: { }); dispatch(doCheckPendingClaims()); dispatch(doFetchCollectionListMine(1, 10)); - resolve(collectionClaim); + return collectionClaim; } function failure(error) { diff --git a/src/redux/actions/collections.js b/src/redux/actions/collections.js index b75d728..39c10c3 100644 --- a/src/redux/actions/collections.js +++ b/src/redux/actions/collections.js @@ -55,7 +55,8 @@ export const doCollectionDelete = (id: string, colKey: ?string = undefined) => ( collectionKey: colKey, }, }); - if (claim) { + if (claim && !colKey) { + // could support "abandon, but keep" later const { txid, nout } = claim; return dispatch(doAbandonClaim(txid, nout, collectionDelete)); } @@ -92,7 +93,7 @@ export const doFetchItemsInCollections = ( pageSize?: number, }, resolveStartedCallback?: () => void -) => async(dispatch: Dispatch, getState: GetState) => { +) => async (dispatch: Dispatch, getState: GetState) => { /* 1) make sure all the collection claims are loaded into claims reducer, search/resolve if necessary. 2) get the item claims for each @@ -328,7 +329,7 @@ export const doFetchItemsInCollection = ( return doFetchItemsInCollections(newOptions, cb); }; -export const doCollectionEdit = (collectionId: string, params: CollectionEditParams) => async( +export const doCollectionEdit = (collectionId: string, params: CollectionEditParams) => async ( dispatch: Dispatch, getState: GetState ) => {