Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct the bee version detection #645

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ReactElement, useContext } from 'react'
import { Link } from 'react-router-dom'
import FilesIcon from 'remixicon-react/ArrowUpDownLineIcon'
import DocsIcon from 'remixicon-react/BookOpenLineIcon'
import GithubIcon from 'remixicon-react/GithubFillIcon'
import ExternalLinkIcon from 'remixicon-react/ExternalLinkLineIcon'
import HomeIcon from 'remixicon-react/Home3LineIcon'
import SettingsIcon from 'remixicon-react/Settings2LineIcon'
Expand All @@ -17,6 +18,7 @@ import SideBarItem from './SideBarItem'
import SideBarStatus from './SideBarStatus'
import { BeeModes } from '@ethersphere/bee-js'
import { BEE_DOCS_HOST } from '../constants'
import { GITHUB_BEE_DASHBOARD_URL } from '../constants'

const drawerWidth = 300

Expand Down Expand Up @@ -126,6 +128,16 @@ export default function SideBar(): ReactElement {
/>
</MUILink>
</List>
<Divider className={classes.divider} />
<List>
<MUILink href={GITHUB_BEE_DASHBOARD_URL} target="_blank" className={classes.link}>
<SideBarItem
iconStart={<GithubIcon className={classes.icon} />}
iconEnd={<ExternalLinkIcon className={classes.icon} color="#595959" />}
label={<span>Github repository</span>}
/>
</MUILink>
</List>
</Grid>
<Grid>
<List>
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const BLOCKCHAIN_EXPLORER_URL = 'https://blockscout.com/xdai/mainnet'
export const BEE_DOCS_HOST = 'https://docs.ethswarm.org/docs/'
export const BEE_DISCORD_HOST = 'https://discord.gg/eKr9XPv7'
export const GITHUB_REPO_URL = 'https://api.github.com/repos/ethersphere/bee'
export const GITHUB_BEE_DASHBOARD_URL = 'https://github.com/ethersphere/bee-dashboard.git'
export const BEE_DESKTOP_LATEST_RELEASE_PAGE = 'https://github.com/ethersphere/bee-desktop/releases/latest'
export const BEE_DESKTOP_LATEST_RELEASE_PAGE_API =
'https://api.github.com/repos/ethersphere/bee-desktop/releases/latest'
Expand Down
9 changes: 7 additions & 2 deletions src/providers/Bee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,17 @@ function getStatus(
error: Error | null,
isDesktop: boolean,
startedAt: number,
latestPublishedVersion: string | undefined,
latestUserVersion: string | undefined,
): Status {
const status: Status = { ...initialValues.status }

// Version check
status.version.isEnabled = !isDesktop
status.version.checkState =
debugApiHealth &&
semver.satisfies(debugApiHealth.version, PackageJson.engines.bee, {
latestPublishedVersion &&
latestUserVersion &&
semver.satisfies(latestPublishedVersion, latestUserVersion, {
includePrerelease: true,
})
? CheckState.OK
Expand Down Expand Up @@ -435,6 +438,8 @@ export function Provider({ children, isDesktop }: Props): ReactElement {
error,
Boolean(isDesktop),
startedAt,
latestPublishedVersion,
latestUserVersion,
)

useEffect(() => {
Expand Down
Loading