fix: add delay to cipher text

This commit is contained in:
MAZE 2025-03-25 17:54:12 +03:30
parent 87f64e6574
commit 4895a7266d

View file

@ -12,10 +12,12 @@ export function CipherText({ interval = 50, text }: CipherTextProps) {
const [isMounted, setIsMounted] = useState(false); const [isMounted, setIsMounted] = useState(false);
useEffect(() => { useEffect(() => {
setIsMounted(true); setTimeout(() => setIsMounted(true), 2000);
}, []); }, []);
useEffect(() => { useEffect(() => {
if (!isMounted) return;
let timer: NodeJS.Timeout; let timer: NodeJS.Timeout;
if (outputText !== text) { if (outputText !== text) {
@ -29,7 +31,7 @@ export function CipherText({ interval = 50, text }: CipherTextProps) {
} }
return () => clearInterval(timer); return () => clearInterval(timer);
}, [text, interval, outputText]); }, [text, interval, outputText, isMounted]);
useEffect(() => { useEffect(() => {
if (outputText === text) { if (outputText === text) {