Skip to content

Commit

Permalink
fix: new bee version notification is only shown if user bee version i…
Browse files Browse the repository at this point in the history
…s detected (#512)

* fix: new bee version notification is only shown if user bee version is detected

* chore: add missing useEffect dependency
  • Loading branch information
vojtechsimetka authored Aug 2, 2022
1 parent 4c48657 commit 1be5cbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/layout/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ interface Props {
const Dashboard = (props: Props): ReactElement => {
const classes = useStyles()

const { isLoading, isLatestBeeVersion, latestBeeRelease, latestBeeVersionUrl } = useContext(BeeContext)
const { isLoading, isLatestBeeVersion, latestBeeRelease, latestBeeVersionUrl, latestUserVersion } =
useContext(BeeContext)
const { isBeeDesktop } = useContext(SettingsContext)
const { newBeeDesktopVersion } = useNewBeeDesktopVersion(isBeeDesktop)
const { enqueueSnackbar, closeSnackbar } = useSnackbar()

// New version of Bee client notification
useEffect(() => {
if (!isLoading && !isBeeDesktop && !isLatestBeeVersion && latestBeeRelease) {
if (!isLoading && !isBeeDesktop && !isLatestBeeVersion && latestBeeRelease && latestUserVersion) {
enqueueSnackbar(`There is new Bee version ${latestBeeRelease?.name}!`, {
variant: 'warning',
preventDuplicate: true,
Expand Down Expand Up @@ -71,6 +72,7 @@ const Dashboard = (props: Props): ReactElement => {
latestBeeRelease,
latestBeeVersionUrl,
isLoading,
latestUserVersion,
])

useEffect(() => {
Expand Down

0 comments on commit 1be5cbd

Please sign in to comment.