diff --git a/packages/atlas/src/hooks/useChannelFormSubmit.ts b/packages/atlas/src/hooks/useChannelFormSubmit.ts index 4c95d97f4d..d6bc390c07 100644 --- a/packages/atlas/src/hooks/useChannelFormSubmit.ts +++ b/packages/atlas/src/hooks/useChannelFormSubmit.ts @@ -68,10 +68,10 @@ type CreateEditChannelSubmitParams = { | undefined } -export const useCreateEditChannelSubmit = () => { +export const useCreateEditChannelSubmit = (initialChannelId?: string) => { const { joystream, proxyCallback } = useJoystream() - const { channelId, memberId, refetchUserMemberships } = useUser() - + const { channelId: activeChannelId, memberId, refetchUserMemberships } = useUser() + const channelId = initialChannelId || activeChannelId const addNewChannelIdToUploadsStore = useUploadsStore((state) => state.actions.addNewChannelId) const getBucketsConfigForNewChannel = useBucketsConfigForNewChannel() const { channelStateBloatBondValue, dataObjectStateBloatBondValue } = useBloatFeesAndPerMbFees() diff --git a/packages/atlas/src/views/global/YppLandingView/YppAuthorizationModal/YppAuthorizationModal.tsx b/packages/atlas/src/views/global/YppLandingView/YppAuthorizationModal/YppAuthorizationModal.tsx index 783ed28df1..26fdb27791 100644 --- a/packages/atlas/src/views/global/YppLandingView/YppAuthorizationModal/YppAuthorizationModal.tsx +++ b/packages/atlas/src/views/global/YppLandingView/YppAuthorizationModal/YppAuthorizationModal.tsx @@ -203,7 +203,7 @@ export const YppAuthorizationModal: FC = ({ unSynced [setSelectedChannelId, setYtRequirementsErrors] ) - const createOrUpdateChannel = useCreateEditChannelSubmit() + const createOrUpdateChannel = useCreateEditChannelSubmit(selectedChannelId ?? undefined) const handleCreateOrUpdateChannel = detailsFormMethods.handleSubmit(async (data) => { setFinalFormData(() => ({