Skip to content
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

Publish: attempt to handle replay name-clash failures #2932

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions ui/redux/actions/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
import {
selectPublishFormValue,
selectPublishFormValues,
selectMyClaimForUri,
selectIsStillEditing,
selectMemberRestrictionStatus,
} from 'redux/selectors/publish';
Expand Down Expand Up @@ -594,9 +593,6 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, claimType: string
} = value;

let state = getState();
const myClaimForUri = selectMyClaimForUri(state);
const { claim_id } = myClaimForUri || {};
// ^--- can we just use 'claim.claim_id'?

const isPostClaim = makeSelectFileRenderModeForUri(claim?.permanent_url)(state) === RENDER_MODES.MARKDOWN;
const isLivestreamClaim = isStreamPlaceholderClaim(claim);
Expand All @@ -614,7 +610,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, claimType: string
type,
...(liveCreateType ? { liveCreateType } : {}),
...(liveEditType ? { liveEditType } : {}),
claim_id: claim_id,
claim_id: claim.claim_id,
name,
bid: Number(amount),
author,
Expand Down Expand Up @@ -760,13 +756,13 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, claimType: string

export const doPublish =
(success: Function, fail: Function, previewFn?: Function, payload?: FileUploadSdkParams) =>
(dispatch: Dispatch, getState: () => {}) => {
(dispatch: Dispatch, getState: GetState) => {
if (!previewFn) {
dispatch({ type: ACTIONS.PUBLISH_START });
}

const state = getState();
const myClaimForUri = selectMyClaimForUri(state);
const myClaimForUri = state.publish.claimToEdit;
const myChannels = selectMyChannelClaims(state);
// const myClaims = selectMyClaimsWithoutChannels(state);
// get redux publish form
Expand All @@ -780,7 +776,7 @@ export const doPublish =

const { channel_id: channelClaimId } = publishPayload;

const existingClaimId = myClaimForUri?.claim_id;
const existingClaimId = myClaimForUri?.claim_id || '';

// hit backend to save restricted memberships
// hit the backend immediately to save the data, we will overwrite it if publish succeeds
Expand Down
Loading