Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: quick hook to solve the delay problem in reposts

Nevo David93205fb2dbc0
diff --git a/apps/frontend/src/components/launches/internal.channels.tsx b/apps/frontend/src/components/launches/internal.channels.tsx
index 028376316..ec966bb4a 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<Integrations[]>(
(val || []).map((p: any) => ({ ...p }))
);
@@ -109,6 +111,10 @@ const Plug: FC<{
)
);
+ if (!load) {
+ return null;
+ }
+
return (
<div
key={plug.title}
diff --git a/apps/frontend/src/components/launches/providers/high.order.provider.tsx b/apps/frontend/src/components/launches/providers/high.order.provider.tsx
index 9010519b1..6ac1982b3 100644
--- a/apps/frontend/src/components/launches/providers/high.order.provider.tsx
+++ b/apps/frontend/src/components/launches/providers/high.order.provider.tsx
@@ -384,7 +384,9 @@ export const withProvider = function <T extends object>(
).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 746467c92..d7773cf2b 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"
},
}),
];