Skip to content

Commit 3bc5353

Browse files
committed
lint fix
1 parent 67bdea8 commit 3bc5353

File tree

1 file changed

+64
-16
lines changed

1 file changed

+64
-16
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/topic-selector-modal.tsx

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,12 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
224224
};
225225

226226
if (formData.sigHash) {
227-
const sigHashes = Array.isArray(formData.sigHash) ? formData.sigHash : [formData.sigHash];
227+
const sigHashes = Array.isArray(formData.sigHash)
228+
? formData.sigHash
229+
: [formData.sigHash];
228230
filters.signatures = sigHashes
229-
.filter(hash => hash)
230-
.map(hash => ({
231+
.filter((hash) => hash)
232+
.map((hash) => ({
231233
sig_hash: hash.startsWith("0x")
232234
? hash
233235
: keccak256(new TextEncoder().encode(hash)),
@@ -272,10 +274,12 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
272274
}
273275

274276
if (formData.sigHash) {
275-
const sigHashes = Array.isArray(formData.sigHash) ? formData.sigHash : [formData.sigHash];
277+
const sigHashes = Array.isArray(formData.sigHash)
278+
? formData.sigHash
279+
: [formData.sigHash];
276280
filters.signatures = sigHashes
277-
.filter(hash => hash)
278-
.map(hash => ({
281+
.filter((hash) => hash)
282+
.map((hash) => ({
279283
sig_hash: hash.startsWith("0x")
280284
? hash
281285
: toFunctionSelector(hash),
@@ -500,9 +504,21 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
500504
(sig) =>
501505
sig.signature,
502506
);
503-
const values = Array.isArray(val) ? val : [val];
504-
const hasCustomSignature = values.some(v => v && !known.includes(v));
505-
if (hasCustomSignature) {
507+
const values =
508+
Array.isArray(val)
509+
? val
510+
: [val];
511+
const hasCustomSignature =
512+
values.some(
513+
(v) =>
514+
v &&
515+
!known.includes(
516+
v,
517+
),
518+
);
519+
if (
520+
hasCustomSignature
521+
) {
506522
eventFilterForm.setValue(
507523
"abi",
508524
"",
@@ -546,9 +562,21 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
546562
(sig) =>
547563
sig.signature,
548564
);
549-
const values = Array.isArray(val) ? val : [val];
550-
const hasCustomSignature = values.some(v => v && !known.includes(v));
551-
if (hasCustomSignature) {
565+
const values =
566+
Array.isArray(val)
567+
? val
568+
: [val];
569+
const hasCustomSignature =
570+
values.some(
571+
(v) =>
572+
v &&
573+
!known.includes(
574+
v,
575+
),
576+
);
577+
if (
578+
hasCustomSignature
579+
) {
552580
transactionFilterForm.setValue(
553581
"abi",
554582
"",
@@ -735,9 +763,21 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
735763
(sig) =>
736764
sig.signature,
737765
);
738-
const values = Array.isArray(val) ? val : [val];
739-
const hasCustomSignature = values.some(v => v && !known.includes(v));
740-
if (hasCustomSignature) {
766+
const values =
767+
Array.isArray(val)
768+
? val
769+
: [val];
770+
const hasCustomSignature =
771+
values.some(
772+
(v) =>
773+
v &&
774+
!known.includes(
775+
v,
776+
),
777+
);
778+
if (
779+
hasCustomSignature
780+
) {
741781
transactionFilterForm.setValue(
742782
"abi",
743783
"",
@@ -771,7 +811,15 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
771811
}
772812
onChange={field.onChange}
773813
placeholder="Fetching function signatures..."
774-
value={Array.isArray(field.value) ? field.value.join(", ") : field.value || ""}
814+
value={
815+
Array.isArray(
816+
field.value,
817+
)
818+
? field.value.join(
819+
", ",
820+
)
821+
: field.value || ""
822+
}
775823
/>
776824
)}
777825
</FormControl>

0 commit comments

Comments
 (0)