修复定时器与动画回调清理不完整问题
This commit is contained in:
@@ -42,7 +42,11 @@ export default function BlindboxRoomPage() {
|
||||
const timersRef = useRef<ReturnType<typeof setTimeout>[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => { timersRef.current.forEach(clearTimeout); };
|
||||
const timers = timersRef.current;
|
||||
return () => {
|
||||
timers.forEach(clearTimeout);
|
||||
timers.length = 0;
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Hook: Room
|
||||
@@ -58,7 +62,6 @@ export default function BlindboxRoomPage() {
|
||||
input, setInput, submitting, suggestions, suggestionsLoading,
|
||||
suggestionsSource, poolCount, setPoolCount, myIdeas, drawnHistory,
|
||||
setDrawnHistory, submitFlash, error, setError, inputRef,
|
||||
boxControls: ideaBoxControls,
|
||||
fetchIdeas, fetchSuggestions, refreshSuggestions,
|
||||
handleSubmit, handleEditIdea, handleDeleteIdea,
|
||||
} = useBlindboxIdeas(room, profile);
|
||||
|
||||
Reference in New Issue
Block a user