Fixs cookies acceptance

This commit is contained in:
apane 2019-11-27 11:23:40 -03:00
parent 26b420742d
commit a9dee4c44a
1 changed files with 7 additions and 6 deletions

View File

@ -89,7 +89,11 @@ const CookiesBanner = () => {
fetchCookiesFromStorage() fetchCookiesFromStorage()
}, []) }, [])
const acceptCookiesHandler = async (newState: CookiesProps) => { const acceptCookiesHandler = async () => {
const newState = {
acceptedNecessary: true,
acceptedAnalytics: true,
}
await saveToStorage(COOKIES_KEY, newState) await saveToStorage(COOKIES_KEY, newState)
setShowBanner(false) setShowBanner(false)
} }
@ -97,7 +101,7 @@ const CookiesBanner = () => {
const closeCookiesBannerHandler = async () => { const closeCookiesBannerHandler = async () => {
const newState = { const newState = {
acceptedNecessary: true, acceptedNecessary: true,
acceptedAnalytics: false, acceptedAnalytics: localAnalytics,
} }
await saveToStorage(COOKIES_KEY, newState) await saveToStorage(COOKIES_KEY, newState)
setShowBanner(false) setShowBanner(false)
@ -149,10 +153,7 @@ We use cookies to give you the best
component={Link} component={Link}
minWidth={180} minWidth={180}
variant="outlined" variant="outlined"
onClick={() => acceptCookiesHandler({ onClick={() => acceptCookiesHandler()}
acceptedNecessary: localNecessary,
acceptedAnalytics: localAnalytics,
})}
> >
Accept Cookies Accept Cookies
</Button> </Button>