fix some react errors

This commit is contained in:
HF 2022-07-11 18:01:01 +02:00
parent 4dca37e67a
commit 4182f1a6e3
2 changed files with 13 additions and 10 deletions

View File

@ -54,7 +54,7 @@ const Captcha = ({ autoload, width }) => {
setCaptchaData({ url: svgUrl, id: captchaid });
};
useEffect(async () => {
useEffect(() => {
if (autoload) {
reloadCaptcha();
}

View File

@ -16,7 +16,8 @@ function getUserFromUrl(url) {
const TikTok = ({ url }) => {
const [embedCode, setEmbedCode] = useState(null);
useEffect(async () => {
useEffect(() => {
async function fetchData() {
const prot = window.location.protocol.startsWith('http')
? window.location.protocol : 'https';
// eslint-disable-next-line max-len
@ -26,6 +27,8 @@ const TikTok = ({ url }) => {
if (embedData.html) {
setEmbedCode(embedData.html);
}
}
fetchData();
}, []);
if (!embedCode) {