File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/pages/SurpriseVault/components Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -82,17 +82,17 @@ const VaultDashboard: React.FC = () => {
8282
8383 // Cleanup VaultService on component unmount to prevent memory leaks
8484 useEffect ( ( ) => {
85- return ( ) => {
85+ const cleanup = ( ) => {
8686 // Only call destroy if we're unmounting and vaultService exists
8787 if ( vaultService && vaultService . destroy ) {
88- const timeoutId = setTimeout ( ( ) => {
89- vaultService . destroy ( ) ;
90- } , 100 ) ;
91-
92- return ( ) => clearTimeout ( timeoutId ) ;
88+ vaultService . destroy ( ) ;
9389 }
9490 } ;
95- } , [ ] ) ; // Empty dependency array ensures this only runs on mount/unmount
91+
92+ // Return cleanup function
93+ return cleanup ;
94+ // eslint-disable-next-line react-hooks/exhaustive-deps
95+ } , [ ] ) ; // Empty dependency array intentional - we only want this to run on mount/unmount
9696
9797 const handleJoinLottery = async ( ) => {
9898 if ( ! vaultStats || ! vaultService || ! vaultService . joinLottery ) return ;
You can’t perform that action at this time.
0 commit comments