From bdfd8ae1ee820de7e0c1768d34547e42fd084fdc Mon Sep 17 00:00:00 2001 From: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:00:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=A3=EF=B8=8F=20Specify=20channel=20ID?= =?UTF-8?q?=20to=20update=20in=20YPP=20(#5873)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/atlas/src/hooks/useChannelFormSubmit.ts | 6 +++--- .../YppAuthorizationModal/YppAuthorizationModal.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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(() => ({