Skip to content

Commit

Permalink
Revert "fix: set default type to "internal" if it's somehow missing (#10
Browse files Browse the repository at this point in the history
)" (#16)

This reverts commit 4f9ec69.
  • Loading branch information
marcusforsberg authored Jun 7, 2024
1 parent 3ae5583 commit 43d4cc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/components/LinkTypeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ export function LinkTypeInput({

const selectedType = linkTypes.find((type) => type.value === value) || linkTypes[0]

useEffect(() => {
// Make sure there's always a default value
if (!value) {
onChange(set('internal'))
}
}, [onChange, value])

return (
<MenuButton
button={
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export const isEmailLink = (link: LinkValue): link is EmailLink => link.type ===
export const isPhoneLink = (link: LinkValue): link is PhoneLink => link.type === 'phone'

export const isCustomLink = (link: LinkValue): link is CustomLink =>
!!link.type && !['internal', 'external', 'email', 'phone'].includes(link.type)
!['internal', 'external', 'email', 'phone'].includes(link.type)

0 comments on commit 43d4cc0

Please sign in to comment.