Remove "PWA app ready" notification
parent
0641086c6b
commit
e63b75688a
|
@ -1,3 +1,4 @@
|
|||
import { useEffect } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import styled from 'styled-components'
|
||||
import { useRegisterSW } from 'virtual:pwa-register/react'
|
||||
|
@ -53,25 +54,16 @@ export const ServiceWorker = () => {
|
|||
},
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (offlineReady) {
|
||||
setOfflineReady(false)
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('App is ready to work offline.')
|
||||
}
|
||||
}, [offlineReady, setOfflineReady])
|
||||
|
||||
return (
|
||||
<PromptContainer>
|
||||
{offlineReady && (
|
||||
<StyledMessage type="info">
|
||||
<StyledSmallBody>
|
||||
<Trans>L'application est prête à fonctionner hors ligne.</Trans>
|
||||
</StyledSmallBody>
|
||||
|
||||
<StyledHideButton>
|
||||
<HideButton
|
||||
onClick={() => setOfflineReady(false)}
|
||||
aria-label={t('Fermer')}
|
||||
>
|
||||
×
|
||||
</HideButton>
|
||||
</StyledHideButton>
|
||||
</StyledMessage>
|
||||
)}
|
||||
|
||||
{needRefresh && (
|
||||
<StyledMessage type="info">
|
||||
<StyledSmallBody>
|
||||
|
|
Loading…
Reference in New Issue