fix: type errors

This commit is contained in:
DIYgod 2025-01-25 21:11:52 +08:00
parent b021f31eee
commit 686efe7d62
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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>
)

View File

@ -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)
}