finalize collections sync keys

This commit is contained in:
zeppi 2021-06-01 08:12:02 -04:00 committed by jessopb
parent 06531c6b48
commit f7775fd837
3 changed files with 14 additions and 22 deletions

18
dist/bundle.es.js vendored
View file

@ -4384,7 +4384,7 @@ function doCollectionPublish(options, localId) {
type: COLLECTION_PUBLISH_COMPLETED, type: COLLECTION_PUBLISH_COMPLETED,
data: { claimId: collectionClaim.claim_id } data: { claimId: collectionClaim.claim_id }
}, },
// shift unpublished collection to pending collection with new publish id // move unpublished collection to pending collection with new publish id
// recent publish won't resolve this second. handle it in checkPending // recent publish won't resolve this second. handle it in checkPending
{ {
type: COLLECTION_PENDING, type: COLLECTION_PENDING,
@ -4415,11 +4415,8 @@ function doCollectionPublish(options, localId) {
} }
function doCollectionPublishUpdate(options) { function doCollectionPublishUpdate(options) {
return (dispatch, getState) => { return dispatch => {
const state = getState(); // TODO: implement one click update
// select claim forclaim_id
// get publish params from claim
// $FlowFixMe
const updateParams = { const updateParams = {
bid: creditsToString(options.bid), bid: creditsToString(options.bid),
@ -4441,7 +4438,6 @@ function doCollectionPublishUpdate(options) {
if (options.claims) { if (options.claims) {
updateParams['claims'] = options.claims; updateParams['claims'] = options.claims;
} }
// $FlowFixMe
return new Promise(resolve => { return new Promise(resolve => {
dispatch({ dispatch({
type: COLLECTION_PUBLISH_UPDATE_STARTED type: COLLECTION_PUBLISH_UPDATE_STARTED
@ -7714,11 +7710,11 @@ const collectionsReducer = handleActions({
})); }));
}, },
[USER_STATE_POPULATE]: (state, action) => { [USER_STATE_POPULATE]: (state, action) => {
const { builtinCollectionTest, savedCollectionTest, unpublishedCollectionTest } = action.data; const { builtinCollections, savedCollections, unpublishedCollections } = action.data;
return _extends$e({}, state, { return _extends$e({}, state, {
unpublished: unpublishedCollectionTest || state.unpublished, unpublished: unpublishedCollections || state.unpublished,
builtin: builtinCollectionTest || state.builtin, builtin: builtinCollections || state.builtin,
saved: savedCollectionTest || state.saved saved: savedCollections || state.saved
}); });
}, },
[COLLECTION_ITEMS_RESOLVE_COMPLETED]: (state, action) => { [COLLECTION_ITEMS_RESOLVE_COMPLETED]: (state, action) => {

View file

@ -799,7 +799,7 @@ export function doCollectionPublish(
type: ACTIONS.COLLECTION_PUBLISH_COMPLETED, type: ACTIONS.COLLECTION_PUBLISH_COMPLETED,
data: { claimId: collectionClaim.claim_id }, data: { claimId: collectionClaim.claim_id },
}, },
// shift unpublished collection to pending collection with new publish id // move unpublished collection to pending collection with new publish id
// recent publish won't resolve this second. handle it in checkPending // recent publish won't resolve this second. handle it in checkPending
{ {
type: ACTIONS.COLLECTION_PENDING, type: ACTIONS.COLLECTION_PENDING,
@ -843,11 +843,8 @@ export function doCollectionPublishUpdate(options: {
languages?: Array<string>, languages?: Array<string>,
claims?: Array<string>, claims?: Array<string>,
}) { }) {
return (dispatch: Dispatch, getState: GetState) => { return (dispatch: Dispatch): Promise<any> => {
const state = getState(); // TODO: implement one click update
// select claim forclaim_id
// get publish params from claim
// $FlowFixMe
const updateParams: { const updateParams: {
bid?: string, bid?: string,
@ -880,7 +877,6 @@ export function doCollectionPublishUpdate(options: {
if (options.claims) { if (options.claims) {
updateParams['claims'] = options.claims; updateParams['claims'] = options.claims;
} }
// $FlowFixMe
return new Promise(resolve => { return new Promise(resolve => {
dispatch({ dispatch({
type: ACTIONS.COLLECTION_PUBLISH_UPDATE_STARTED, type: ACTIONS.COLLECTION_PUBLISH_UPDATE_STARTED,

View file

@ -159,12 +159,12 @@ const collectionsReducer = handleActions(
}); });
}, },
[ACTIONS.USER_STATE_POPULATE]: (state, action) => { [ACTIONS.USER_STATE_POPULATE]: (state, action) => {
const { builtinCollectionTest, savedCollectionTest, unpublishedCollectionTest } = action.data; const { builtinCollections, savedCollections, unpublishedCollections } = action.data;
return { return {
...state, ...state,
unpublished: unpublishedCollectionTest || state.unpublished, unpublished: unpublishedCollections || state.unpublished,
builtin: builtinCollectionTest || state.builtin, builtin: builtinCollections || state.builtin,
saved: savedCollectionTest || state.saved, saved: savedCollections || state.saved,
}; };
}, },
[ACTIONS.COLLECTION_ITEMS_RESOLVE_COMPLETED]: (state, action) => { [ACTIONS.COLLECTION_ITEMS_RESOLVE_COMPLETED]: (state, action) => {