Skip to content

Commit 04e09cf

Browse files
committed
Cleanup
1 parent 6ce06f9 commit 04e09cf

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

packages/connect-react/src/components/InternalComponentForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import { InternalField } from "./InternalField";
1313
import { Alert } from "./Alert";
1414
import { ErrorBoundary } from "./ErrorBoundary";
1515
import { ControlSubmit } from "./ControlSubmit";
16-
import type { ConfigurableProp } from "@pipedream/sdk";
16+
import type {
17+
ConfigurableProp, ConfigurablePropAlert,
18+
} from "@pipedream/sdk";
1719

1820
export function InternalComponentForm() {
1921
const formContext = useFormContext();

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export const FormContextProvider = <T extends ConfigurableProps>({
102102
] = useState<Record<string, string>[]>([])
103103

104104
const [
105-
enableDebugging,
106-
setEnableDebugging,
105+
enableDebugging
106+
,
107107
] = useState<boolean>(__enableDebugging === true)
108108

109109
const [
@@ -464,6 +464,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
464464
message,
465465
} as Record<string, string>)
466466
}
467+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
467468
} catch (e) {
468469
// pass
469470
}
@@ -498,10 +499,11 @@ export const FormContextProvider = <T extends ConfigurableProps>({
498499
if (data && "observations" in data) {
499500
const obs = data.observations || []
500501
if (obs && obs.length > 0) {
502+
const res = obs.filter((it) => it.k === "error")
503+
?.map(handleObservationErrors)
504+
?.filter((e) => e !== undefined) || []
501505
newErrors.push(
502-
...obs?.filter((it) => it.k === "error")
503-
.map(handleObservationErrors)
504-
.filter((e) => e !== undefined),
506+
...res,
505507
)
506508
}
507509
} else if (data && "error" in data && "details" in data) {
@@ -516,6 +518,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
516518
// })
517519
})
518520
}
521+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
519522
} catch (e) {
520523
// pass
521524
}

0 commit comments

Comments
 (0)