fix: resolve CI lint errors in Sidebar, TypingIndicator, and useGateway
- Sidebar: replace useEffect setState with callback pattern for filter reset - TypingIndicator: initialize useRef with 0 instead of impure Date.now() - TypingIndicator: remove redundant setElapsed(0) from mount effect - useGateway: remove unused eslint-disable directive
This commit is contained in:
@@ -12,11 +12,10 @@ function formatElapsed(seconds: number): string {
|
||||
export function TypingIndicator() {
|
||||
const t = useT();
|
||||
const [elapsed, setElapsed] = useState(0);
|
||||
const startRef = useRef(Date.now());
|
||||
const startRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
startRef.current = Date.now();
|
||||
setElapsed(0);
|
||||
const interval = setInterval(() => {
|
||||
setElapsed(Math.floor((Date.now() - startRef.current) / 1000));
|
||||
}, 1000);
|
||||
|
||||
Reference in New Issue
Block a user