Skip to content

Commit b3f521c

Browse files
authored
fix: correct the bee version detection (#645)
* feat: Github repository link to ethersphere/bee-dashboard * fix: correct the Bee version detection
1 parent 79bb315 commit b3f521c

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/components/SideBar.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ReactElement, useContext } from 'react'
44
import { Link } from 'react-router-dom'
55
import FilesIcon from 'remixicon-react/ArrowUpDownLineIcon'
66
import DocsIcon from 'remixicon-react/BookOpenLineIcon'
7+
import GithubIcon from 'remixicon-react/GithubFillIcon'
78
import ExternalLinkIcon from 'remixicon-react/ExternalLinkLineIcon'
89
import HomeIcon from 'remixicon-react/Home3LineIcon'
910
import SettingsIcon from 'remixicon-react/Settings2LineIcon'
@@ -17,6 +18,7 @@ import SideBarItem from './SideBarItem'
1718
import SideBarStatus from './SideBarStatus'
1819
import { BeeModes } from '@ethersphere/bee-js'
1920
import { BEE_DOCS_HOST } from '../constants'
21+
import { GITHUB_BEE_DASHBOARD_URL } from '../constants'
2022

2123
const drawerWidth = 300
2224

@@ -126,6 +128,16 @@ export default function SideBar(): ReactElement {
126128
/>
127129
</MUILink>
128130
</List>
131+
<Divider className={classes.divider} />
132+
<List>
133+
<MUILink href={GITHUB_BEE_DASHBOARD_URL} target="_blank" className={classes.link}>
134+
<SideBarItem
135+
iconStart={<GithubIcon className={classes.icon} />}
136+
iconEnd={<ExternalLinkIcon className={classes.icon} color="#595959" />}
137+
label={<span>Github repository</span>}
138+
/>
139+
</MUILink>
140+
</List>
129141
</Grid>
130142
<Grid>
131143
<List>

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const BLOCKCHAIN_EXPLORER_URL = 'https://blockscout.com/xdai/mainnet'
66
export const BEE_DOCS_HOST = 'https://docs.ethswarm.org/docs/'
77
export const BEE_DISCORD_HOST = 'https://discord.gg/eKr9XPv7'
88
export const GITHUB_REPO_URL = 'https://api.github.com/repos/ethersphere/bee'
9+
export const GITHUB_BEE_DASHBOARD_URL = 'https://github.com/ethersphere/bee-dashboard.git'
910
export const BEE_DESKTOP_LATEST_RELEASE_PAGE = 'https://github.com/ethersphere/bee-desktop/releases/latest'
1011
export const BEE_DESKTOP_LATEST_RELEASE_PAGE_API =
1112
'https://api.github.com/repos/ethersphere/bee-desktop/releases/latest'

src/providers/Bee.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,17 @@ function getStatus(
134134
error: Error | null,
135135
isDesktop: boolean,
136136
startedAt: number,
137+
latestPublishedVersion: string | undefined,
138+
latestUserVersion: string | undefined,
137139
): Status {
138140
const status: Status = { ...initialValues.status }
139141

140142
// Version check
141143
status.version.isEnabled = !isDesktop
142144
status.version.checkState =
143-
debugApiHealth &&
144-
semver.satisfies(debugApiHealth.version, PackageJson.engines.bee, {
145+
latestPublishedVersion &&
146+
latestUserVersion &&
147+
semver.satisfies(latestPublishedVersion, latestUserVersion, {
145148
includePrerelease: true,
146149
})
147150
? CheckState.OK
@@ -435,6 +438,8 @@ export function Provider({ children, isDesktop }: Props): ReactElement {
435438
error,
436439
Boolean(isDesktop),
437440
startedAt,
441+
latestPublishedVersion,
442+
latestUserVersion,
438443
)
439444

440445
useEffect(() => {

0 commit comments

Comments
 (0)