From 9de4fcca830a9e060cfe3040f32853794e72aef0 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 5 Jul 2023 21:12:34 -0700 Subject: [PATCH] Fix build errors --- components/MentionList/index.tsx | 2 ++ components/filters/FilterModal/index.tsx | 12 ++++++++---- utils/mentionSuggestions.tsx | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/MentionList/index.tsx b/components/MentionList/index.tsx index b242202f..499fb89a 100644 --- a/components/MentionList/index.tsx +++ b/components/MentionList/index.tsx @@ -120,3 +120,5 @@ export const MentionList = forwardRef( ) } ) + +MentionList.displayName = 'MentionList' diff --git a/components/filters/FilterModal/index.tsx b/components/filters/FilterModal/index.tsx index bc55ce0a..d46cd0cb 100644 --- a/components/filters/FilterModal/index.tsx +++ b/components/filters/FilterModal/index.tsx @@ -199,14 +199,18 @@ const FilterModal = (props: Props) => { setMinWeaponCount(value) } - function handleMaxButtonsCountValueChange(value?: string) { + function handleMaxButtonsCountValueChange( + value?: string | number | readonly string[] + ) { if (!value) return - setMaxButtonsCount(parseInt(value)) + setMaxButtonsCount(value as number) } - function handleMaxTurnsCountValueChange(value?: string) { + function handleMaxTurnsCountValueChange( + value?: string | number | readonly string[] + ) { if (!value) return - setMaxTurnsCount(parseInt(value)) + setMaxTurnsCount(value as number) } function handleNameQualityValueChange(value?: boolean) { diff --git a/utils/mentionSuggestions.tsx b/utils/mentionSuggestions.tsx index d9211b51..18e4b8a9 100644 --- a/utils/mentionSuggestions.tsx +++ b/utils/mentionSuggestions.tsx @@ -47,7 +47,9 @@ function transform(object: RawSearchResponse) { export const mentionSuggestionOptions: MentionOptions['suggestion'] = { items: async ({ query }): Promise => { - const locale = getCookie('NEXT_LOCALE') ?? 'en' + const locale = getCookie('NEXT_LOCALE') + ? (getCookie('NEXT_LOCALE') as string) + : 'en' const response = await api.searchAll(query, locale) const results = response.data.results