diff --git a/src/hooks/web/useMessage.tsx b/src/hooks/web/useMessage.tsx index 06e2592..bae9cd9 100644 --- a/src/hooks/web/useMessage.tsx +++ b/src/hooks/web/useMessage.tsx @@ -35,21 +35,30 @@ interface ConfirmOptions { } function getIcon(iconType: string) { - if (iconType === 'warning') { - return ; - } else if (iconType === 'success') { - return ; - } else if (iconType === 'info') { - return ; - } else { - return ; + try { + if (iconType === 'warning') { + return ; + } else if (iconType === 'success') { + return ; + } else if (iconType === 'info') { + return ; + } else { + return ; + } + } catch(e) { + console.log(e); } } function renderContent({ content }: Pick) { - if (isString(content)) { - return
${content as string}
`}>; - } else { + try { + if (isString(content)) { + return
${content as string}
`}>; + } else { + return content; + } + } catch(e) { + console.log(e); return content; } }