From fbe71c4116670b435f49b5eadd7145ac571da9d6 Mon Sep 17 00:00:00 2001 From: Crash-- Date: Thu, 19 Oct 2023 09:16:15 +0200 Subject: [PATCH] fix: Don't add no needed dep to useEffect --- src/hooks/usePreferedTheme.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hooks/usePreferedTheme.ts b/src/hooks/usePreferedTheme.ts index 89e239f3b3..b5bbe69b7c 100644 --- a/src/hooks/usePreferedTheme.ts +++ b/src/hooks/usePreferedTheme.ts @@ -1,6 +1,5 @@ import { useState, useEffect } from 'react' import useCustomWallpaper from 'hooks/useCustomWallpaper' -import { useClient } from 'cozy-client' const getHomeThemeCssVariable = (): string => { return getComputedStyle(document.getElementsByTagName('body')[0]) @@ -9,9 +8,7 @@ const getHomeThemeCssVariable = (): string => { } export const usePreferedTheme = (): string => { - const client = useClient() const { - fetchStatus, data: { wallpaperLink } } = useCustomWallpaper() const [preferedTheme, setPreferedTheme] = useState('inverted') @@ -24,7 +21,7 @@ export const usePreferedTheme = (): string => { } else { setPreferedTheme(preferedTheme || 'inverted') } - }, [wallpaperLink, fetchStatus, client]) + }, [wallpaperLink]) return preferedTheme }