diff --git a/apps/frontend/src/components/launches/internal.channels.tsx b/apps/frontend/src/components/launches/internal.channels.tsx index 02837631..ec966bb4 100644 --- a/apps/frontend/src/components/launches/internal.channels.tsx +++ b/apps/frontend/src/components/launches/internal.channels.tsx @@ -87,14 +87,16 @@ const Plug: FC<{ }> = ({ plug }) => { const { allIntegrations, integration } = useIntegration(); const { watch, setValue, control, register } = useSettings(); + const [load, setLoad] = useState(false); const val = watch(`plug--${plug.identifier}--integrations`); const active = watch(`plug--${plug.identifier}--active`); - // const selectedIntegrationsValue = watch( - // `plug.${plug.identifier}.integrations` - // ); - // - // console.log(selectedIntegrationsValue); + useEffect(() => { + setTimeout(() => { + setLoad(true); + }, 20); + }, []); + const [localValue, setLocalValue] = useState( (val || []).map((p: any) => ({ ...p })) ); @@ -109,6 +111,10 @@ const Plug: FC<{ ) ); + if (!load) { + return null; + } + return (
( ).json(); }, [props.identifier]); - const { data } = useSWR(`internal-${props.identifier}`, getInternalPlugs); + const { data } = useSWR(`internal-${props.identifier}`, getInternalPlugs, { + revalidateOnReconnect: true, + }); // this is a trick to prevent the data from being deleted, yet we don't render the elements if (!props.show) { diff --git a/eslint.config.mjs b/eslint.config.mjs index 746467c9..d7773cf2 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -20,6 +20,7 @@ const eslintConfig = [ "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-empty-object-type": "off", "@typescript-eslint/prefer-as-const": "off", + "@typescript-eslint/no-non-null-asserted-optional-chain": "off" }, }), ];