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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user