@@ -41,6 +41,7 @@ interface Status {
41
41
}
42
42
43
43
interface ContextInterface {
44
+ beeVersion : string | null
44
45
status : Status
45
46
error : Error | null
46
47
apiHealth : boolean
@@ -65,6 +66,7 @@ interface ContextInterface {
65
66
}
66
67
67
68
const initialValues : ContextInterface = {
69
+ beeVersion : null ,
68
70
status : {
69
71
all : CheckState . ERROR ,
70
72
apiConnection : { isEnabled : false , checkState : CheckState . ERROR } ,
@@ -164,6 +166,7 @@ interface Props {
164
166
165
167
export function Provider ( { children } : Props ) : ReactElement {
166
168
const { beeApi } = useContext ( SettingsContext )
169
+ const [ beeVersion , setBeeVersion ] = useState < string | null > ( null )
167
170
const [ apiHealth , setApiHealth ] = useState < boolean > ( false )
168
171
const [ nodeAddresses , setNodeAddresses ] = useState < NodeAddresses | null > ( null )
169
172
const [ nodeInfo , setNodeInfo ] = useState < NodeInfo | null > ( null )
@@ -262,11 +265,13 @@ export function Provider({ children }: Props): ReactElement {
262
265
}
263
266
264
267
const promises = [
265
- // API health
266
268
beeApi
267
- . isConnected ( { timeout : TIMEOUT } )
268
- . then ( setApiHealth )
269
- . catch ( ( ) => setApiHealth ( false ) ) ,
269
+ . getHealth ( { timeout : TIMEOUT } )
270
+ . then ( response => setBeeVersion ( response . version ) )
271
+ . catch ( ( ) => setBeeVersion ( null ) ) ,
272
+
273
+ // API health
274
+ beeApi . isConnected ( { timeout : TIMEOUT } ) . catch ( ( ) => setApiHealth ( false ) ) ,
270
275
271
276
// Node Addresses
272
277
beeApi
@@ -376,6 +381,7 @@ export function Provider({ children }: Props): ReactElement {
376
381
return (
377
382
< Context . Provider
378
383
value = { {
384
+ beeVersion,
379
385
status,
380
386
error,
381
387
apiHealth,
0 commit comments