From 1be5cbda6de073f1e569ab92f178d815548a461b Mon Sep 17 00:00:00 2001 From: Vojtech Simetka Date: Tue, 2 Aug 2022 12:44:33 +0200 Subject: [PATCH] fix: new bee version notification is only shown if user bee version is detected (#512) * fix: new bee version notification is only shown if user bee version is detected * chore: add missing useEffect dependency --- src/layout/Dashboard.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layout/Dashboard.tsx b/src/layout/Dashboard.tsx index 239594be..161be1e4 100644 --- a/src/layout/Dashboard.tsx +++ b/src/layout/Dashboard.tsx @@ -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, @@ -71,6 +72,7 @@ const Dashboard = (props: Props): ReactElement => { latestBeeRelease, latestBeeVersionUrl, isLoading, + latestUserVersion, ]) useEffect(() => {