Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit 502f514

Browse files
committed
refactor: reuse isTextField typeguard function
1 parent 0985bf0 commit 502f514

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ui/page/share/dataset/steps/completeTransaction/completeTransaction.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'
33
import * as O from 'fp-ts/Option'
44
import { flow, pipe } from 'fp-ts/lib/function'
55
import { formatISODateToParts, localizedDateFormatter } from '@/util/date/date'
6-
import type { FormItem, TextField } from '@/ui/store/slice/shareData/shareData.slice'
6+
import { isTextField, type TextField } from '@/ui/store/slice/shareData/shareData.slice'
77
import { Button } from '@/ui/component/button/button'
88
import { Icon } from '@/ui/component/icon/icon'
99
import { useAppStore } from '@/ui/store'
@@ -147,8 +147,6 @@ export const CompleteTransaction: FC = () => {
147147
const getFieldValueForText = (item: TextField): string | undefined =>
148148
pipe(item.value, O.toUndefined)
149149

150-
const isTextField = (item: FormItem): item is TextField => item.type === 'text'
151-
152150
const dataSetTitle = pipe(
153151
dataSetTitleField,
154152
O.map(flow(O.fromPredicate(isTextField), O.map(getFieldValueForText), O.toUndefined)),

0 commit comments

Comments
 (0)