Fix build type errors in LinkButton and useMessages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6a9e732457
commit
365895c389
2 files changed
+16
-14
No files matched your search
@@ -7,12 +7,16 @@ export function useMessages() {
|
||||
|
||||
const getMessage = (id: string) => t(`message.${id}`);
|
||||
|
||||
const getErrorMessage = (error: ApiError) => {
|
||||
const getErrorMessage = (error: string | Error | undefined) => {
|
||||
if (!error) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const code = error?.code;
|
||||
if (typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
|
||||
const code = (error as ApiError)?.code;
|
||||
|
||||
return code ? getMessage(code) : error?.message || 'Unknown error';
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user