1
0
mirror of https://github.com/karl0ss/homepage.git synced 2025-05-06 07:23:38 +01:00

Fix error simple string

This commit is contained in:
shamoon 2024-08-13 00:07:16 -07:00
parent 2aa7a3898b
commit 0dc2f2e18a

@ -12,6 +12,10 @@ function displayData(data) {
export default function Error({ error }) { export default function Error({ error }) {
const { t } = useTranslation(); const { t } = useTranslation();
if (typeof error === "string") {
error = { message: error }; // eslint-disable-line no-param-reassign
}
if (error?.data?.error) { if (error?.data?.error) {
error = error.data.error; // eslint-disable-line no-param-reassign error = error.data.error; // eslint-disable-line no-param-reassign
} }