fix: show update notifications only on non-auto-updating Swarm Desktops (#543)

This commit is contained in:
Adam Uhlíř
2022-09-14 02:48:24 -07:00
committed by GitHub
parent 0c74dae4e8
commit 528a810690
3 changed files with 17 additions and 7 deletions
+7 -3
View File
@@ -63,11 +63,15 @@ async function checkNewVersion(desktopUrl: string): Promise<string> {
return ''
}
export function useNewBeeDesktopVersion(isBeeDesktop: boolean, desktopUrl: string): NewDesktopVersionHook {
export function useNewBeeDesktopVersion(
isBeeDesktop: boolean,
desktopUrl: string,
desktopAutoUpdateEnabled: boolean,
): NewDesktopVersionHook {
const [newBeeDesktopVersion, setNewBeeDesktopVersion] = useState<string>('')
useEffect(() => {
if (!isBeeDesktop) {
if (!isBeeDesktop || desktopAutoUpdateEnabled) {
return
}
@@ -76,7 +80,7 @@ export function useNewBeeDesktopVersion(isBeeDesktop: boolean, desktopUrl: strin
setNewBeeDesktopVersion(version)
}
})
}, [isBeeDesktop, desktopUrl])
}, [isBeeDesktop, desktopUrl, desktopAutoUpdateEnabled])
return { newBeeDesktopVersion }
}