Skip to content

Commit

Permalink
fix: Le bouton recharchement ne doit plus être afficher #44
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Aug 17, 2024
1 parent 3dbe0bb commit eea2489
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions electron-app/ecoindex-app/src/renderer/MainWindow/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function TheApp() {
)
return
}
setDisplayReloadButton(false)
showHidePopinDuringProcess(
`${t('Url(s) Measure (Simple mode)')} started 🚀`
)
Expand Down Expand Up @@ -214,6 +215,7 @@ function TheApp() {
)
return
}
setDisplayReloadButton(false)
showHidePopinDuringProcess(
`${t('Courses Measure (Full mode)')} started 🚀`
)
Expand Down Expand Up @@ -356,16 +358,24 @@ function TheApp() {
frontLog.debug(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`)
}, [])

// #endregion

// #region useEffect
useEffect(() => {
const handleDisplayReloadButton = async () => {
const handleDisplayReloadButton = async () => {
frontLog.debug(
`handleDisplayReloadButton launched, isLighthouseEcoindexPluginInstalled`,
isLighthouseEcoindexPluginInstalled
)
if (!isLighthouseEcoindexPluginInstalled) {
setDisplayReloadButton(false)
await _sleep(30000)
setDisplayReloadButton(true)
} else {
frontLog.debug(`handleDisplayReloadButton canceled`)
}
handleDisplayReloadButton()
}

// #endregion

// #region useEffect
useEffect(() => {
/**
* Handlers, install Puppeteer Browser on Host
*/
Expand Down Expand Up @@ -435,6 +445,7 @@ function TheApp() {
*/
const fetchIsLighthousePluginEcoindexInstalled = async () => {
try {
handleDisplayReloadButton()
const result =
await window.electronAPI.isLighthouseEcoindexPluginInstalled()
setIsLighthouseEcoindexPluginInstalled(result.result)
Expand Down Expand Up @@ -809,6 +820,7 @@ function TheApp() {
variant="destructive"
size="sm"
onClick={forceRefresh}
className="max-w-fit"
>
{t('Reload if too long')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const PopinLoading: FC<ILayout> = ({
<div id={id} className="absolute left-0 top-0 z-10 h-screen w-screen">
<div className="absolute h-full w-full bg-background opacity-70"></div>
<div className="absolute grid h-full w-full place-content-center">
<div className="relative flex flex-col gap-2 rounded-md border border-primary bg-background px-4 py-3 shadow-lg shadow-primary/50">
<div className="relative flex flex-col items-center gap-2 rounded-md border border-primary bg-background px-4 py-3 shadow-lg shadow-primary/50">
<div
className={cn(
'flex items-center font-black !text-primary',
Expand Down

0 comments on commit eea2489

Please sign in to comment.