mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix StateLabel doesn't render at first index
This commit is contained in:
@@ -11,12 +11,10 @@ const StateLabel = ({ commentIndex, className }) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setTimeout(() => setIsLoading(false), 2000);
|
const timer = setTimeout(() => setIsLoading(false), 2000);
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
}, []);
|
}, [commentIndex]);
|
||||||
|
|
||||||
if (commentIndex === undefined) return null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
commentIndex && stateString !== "Succeeded" ? (
|
commentIndex !== undefined && stateString !== "Succeeded" ? (
|
||||||
(comment.state === "failed") ? (
|
(comment.state === "failed") ? (
|
||||||
null
|
null
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user