From 38f31f3a8370a01e6096bf1cea3636c65cb27488 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Fri, 27 Jun 2025 12:37:08 +0700 Subject: [PATCH] feat: fix internal channels --- apps/frontend/src/components/new-launch/add.edit.modal.tsx | 5 +---- apps/frontend/src/components/new-launch/editor.tsx | 4 ++-- .../src/components/new-launch/picks.socials.component.tsx | 2 +- .../components/new-launch/providers/high.order.provider.tsx | 4 +++- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/frontend/src/components/new-launch/add.edit.modal.tsx b/apps/frontend/src/components/new-launch/add.edit.modal.tsx index d679a6be..1649fa1a 100644 --- a/apps/frontend/src/components/new-launch/add.edit.modal.tsx +++ b/apps/frontend/src/components/new-launch/add.edit.modal.tsx @@ -40,12 +40,9 @@ export const AddEditModal: FC = (props) => { ); const integrations = useLaunchStore((state) => state.integrations); - useEffect(() => { setDate(props.date || dayjs()); - setAllIntegrations( - (props.integrations || []).filter((f) => !f.inBetweenSteps && !f.disabled) - ); + setAllIntegrations(props.allIntegrations || []); setIsCreateSet(!!props.addEditSets); }, []); diff --git a/apps/frontend/src/components/new-launch/editor.tsx b/apps/frontend/src/components/new-launch/editor.tsx index 07732ee6..3f7b6169 100644 --- a/apps/frontend/src/components/new-launch/editor.tsx +++ b/apps/frontend/src/components/new-launch/editor.tsx @@ -455,10 +455,10 @@ export const Editor: FC<{
props.totalChars && '!text-red-500' + props?.value?.length > props.totalChars && '!text-red-500' )} > - {props.value.length}/{props.totalChars} + {props?.value?.length}/{props.totalChars}
)} diff --git a/apps/frontend/src/components/new-launch/picks.socials.component.tsx b/apps/frontend/src/components/new-launch/picks.socials.component.tsx index e33b8010..e1c2f04f 100644 --- a/apps/frontend/src/components/new-launch/picks.socials.component.tsx +++ b/apps/frontend/src/components/new-launch/picks.socials.component.tsx @@ -28,7 +28,7 @@ export const PicksSocialsComponent: FC<{ toolTip?: boolean }> = ({
{integrations - .filter((f) => !f.inBetweenSteps) + .filter((f) => !f.inBetweenSteps && !f.disabled) .map((integration) => (
( setTab, setTotalChars, justCurrent, + allIntegrations, } = useLaunchStore( useShallow((state) => ({ date: state.date, @@ -70,6 +71,7 @@ export const withProvider = function ( global: state.global, internal: state.internal.find((p) => p.integration.id === props.id), integrations: state.selectedIntegrations, + allIntegrations: state.integrations, justCurrent: state.current, current: state.current === props.id, isGlobal: state.current === 'global', @@ -195,7 +197,7 @@ export const withProvider = function ( value={{ date, integration: selectedIntegration.integration, - allIntegrations: integrations.map((p) => p.integration), + allIntegrations, value: value.map((p) => ({ id: p.id, content: p.content,