...
This commit is contained in:
@@ -12,7 +12,15 @@ export default function Home() {
|
|||||||
if (!reqEnabled) return;
|
if (!reqEnabled) return;
|
||||||
setReqEnabled(false);
|
setReqEnabled(false);
|
||||||
|
|
||||||
respref.current!.innerText = '正在生成国际音标(IPA),请稍等~'
|
respref.current!.innerText = '正在生成国际音标(IPA),请稍等~';
|
||||||
|
let timer: NodeJS.Timeout;
|
||||||
|
(() => {
|
||||||
|
let count = 0;
|
||||||
|
timer = setInterval(() => {
|
||||||
|
respref.current!.innerText = '正在生成国际音标(IPA),请稍等~';
|
||||||
|
respref.current!.innerText += `\n(waiting for ${++count}s)`
|
||||||
|
}, 1000);
|
||||||
|
})();
|
||||||
|
|
||||||
const text = inputref.current!.value.trim();
|
const text = inputref.current!.value.trim();
|
||||||
if (text.length === 0) return;
|
if (text.length === 0) return;
|
||||||
@@ -35,6 +43,7 @@ export default function Home() {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setReqEnabled(true);
|
setReqEnabled(true);
|
||||||
|
clearInterval(timer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const readIPA = () => {
|
const readIPA = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user