fix: type errors
This commit is contained in:
parent
b021f31eee
commit
686efe7d62
|
|
@ -60,7 +60,7 @@ export const apiClient = hc<AppType>(getApiUrl(), {
|
|||
},
|
||||
})
|
||||
|
||||
export const getBizFetchErrorMessage = (error: unknown) => {
|
||||
export const getBizFetchErrorMessage = (error: Error) => {
|
||||
if (error instanceof FetchError && error.response) {
|
||||
try {
|
||||
const data = JSON.parse(error.response._data)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const ViewHeaderComponent = ({
|
|||
style={{ paddingTop: insets.top }}
|
||||
>
|
||||
<BlurEffect />
|
||||
<Text className="text-text my-4 text-2xl font-bold">{viewDef.name}</Text>
|
||||
<Text className="text-text my-4 text-2xl font-bold">{viewDef?.name}</Text>
|
||||
<SortActionButton />
|
||||
</View>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export const DataScreen = () => {
|
|||
`Import successful, ${successfulItems.length} feeds were imported, ${conflictItems.length} feeds were already subscribed, and ${parsedErrorItems.length} feeds failed to import.`,
|
||||
)
|
||||
} catch (error) {
|
||||
const bizError = getBizFetchErrorMessage(error)
|
||||
const bizError = getBizFetchErrorMessage(error as Error)
|
||||
toast.error(`Import failed${bizError ? `: ${bizError}` : ""}`)
|
||||
console.error(error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue