Skip to content

Commit 67bdea8

Browse files
committed
build fix
1 parent e03da96 commit 67bdea8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

apps/dashboard/src/@/components/blocks/SignatureSelector.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export function SignatureSelector({
4949
if (multiSelect) {
5050
if (Array.isArray(value)) {
5151
return value.filter(
52-
(val): val is string => val !== undefined && val !== null,
52+
(val): val is string =>
53+
val !== undefined && val !== null && val !== "",
5354
);
5455
} else {
5556
return value ? [value] : [];
@@ -64,20 +65,22 @@ export function SignatureSelector({
6465
}, [value, multiSelect]);
6566

6667
// Check if the current values include custom values (not in options)
67-
const customValues = useMemo(() => {
68+
const customValues = useMemo((): string[] => {
6869
return currentValues.filter(
6970
(val): val is string =>
7071
val !== undefined &&
7172
val !== null &&
73+
val !== "" &&
7274
!options.some((opt) => opt.value === val),
7375
);
7476
}, [currentValues, options]);
7577

7678
// Add the custom values as options if needed
7779
const allOptions = useMemo(() => {
78-
const customOptions = customValues
79-
.filter((val) => val) // Filter out undefined/null values
80-
.map((val) => ({ label: val!, value: val! }));
80+
const customOptions = customValues.map((val) => ({
81+
label: val,
82+
value: val,
83+
}));
8184
return [...formattedOptions, ...customOptions];
8285
}, [formattedOptions, customValues]);
8386

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/ReviewStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export default function ReviewStep({
196196
<span className="text-muted-foreground text-sm">
197197
Signature Hash
198198
{Array.isArray(form.watch("sigHash")) &&
199-
form.watch("sigHash")?.length > 1
199+
(form.watch("sigHash")?.length || 0) > 1
200200
? "es"
201201
: ""}
202202
:
@@ -209,7 +209,7 @@ export default function ReviewStep({
209209
if (Array.isArray(sigHash)) {
210210
if (sigHash.length === 0) return "None";
211211
if (sigHash.length === 1) {
212-
return truncateMiddle(sigHash[0], 10, 6);
212+
return truncateMiddle(sigHash[0] || "", 10, 6);
213213
}
214214
return `${sigHash.length} signature${sigHash.length > 1 ? "s" : ""} selected`;
215215
} else {

0 commit comments

Comments
 (0)