1- import React , { useState , useEffect } from 'react' ;
1+ import React , { useState , useEffect , useCallback } from 'react' ;
22import { Alert , Card , Button , Space , Typography } from 'antd' ;
33import { ExclamationCircleOutlined , CheckCircleOutlined , ReloadOutlined } from '@ant-design/icons' ;
44import styled from 'styled-components' ;
@@ -109,7 +109,7 @@ export const NostrExtensionCheck: React.FC<NostrExtensionCheckProps> = ({ onExte
109109 const [ hasExtension , setHasExtension ] = useState ( false ) ;
110110 const [ isChecking , setIsChecking ] = useState ( true ) ;
111111
112- const checkExtension = ( ) => {
112+ const checkExtension = useCallback ( ( ) => {
113113 setIsChecking ( true ) ;
114114
115115 // Check if window.nostr exists
@@ -120,7 +120,7 @@ export const NostrExtensionCheck: React.FC<NostrExtensionCheckProps> = ({ onExte
120120 if ( extensionExists && onExtensionReady ) {
121121 onExtensionReady ( ) ;
122122 }
123- } ;
123+ } , [ onExtensionReady ] ) ;
124124
125125 useEffect ( ( ) => {
126126 // Initial check
@@ -135,7 +135,7 @@ export const NostrExtensionCheck: React.FC<NostrExtensionCheckProps> = ({ onExte
135135 } , 1000 ) ;
136136
137137 return ( ) => clearInterval ( pollInterval ) ;
138- } , [ hasExtension , onExtensionReady ] ) ;
138+ } , [ hasExtension , checkExtension ] ) ;
139139
140140 const extensions = [
141141 {
0 commit comments