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)
|
if (!process.env.ALERT_TEXT_URL)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
const response: Response = await fetch(process.env.ALERT_TEXT_URL, { cache: "no-cache" });
|
const response: Response = await fetch(process.env.ALERT_TEXT_URL, { cache: "no-cache" });
|
||||||
const alertText: string = await response.text();
|
const alertText: string = await response.text();
|
||||||
|
|
||||||
@@ -36,6 +38,11 @@ const AlertMessage: React.FC = async () =>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AlertMessage;
|
export default AlertMessage;
|
||||||
|
|||||||
Reference in New Issue
Block a user