1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

fix: fixed possibe requrest timeout for AlertMessage

This commit is contained in:
2024-10-09 14:15:09 +00:00
parent eaac40f806
commit f096a5682b
+7
View File
@@ -18,6 +18,8 @@ const AlertMessage: React.FC = async () =>
if (!process.env.ALERT_TEXT_URL)
return null;
try
{
const response: Response = await fetch(process.env.ALERT_TEXT_URL, { cache: "no-cache" });
const alertText: string = await response.text();
@@ -36,6 +38,11 @@ const AlertMessage: React.FC = async () =>
</div>
</div>
);
}
catch
{
return null;
}
};
export default AlertMessage;