fix: filemanager state handling (#232)

* fix: filemanager state handling
* refactor: fm provider and fm page
* fix: detect bee warmup and wait more for syncing
* refactor: optimize bee provider to avoid rerenders
---------

Co-authored-by: Roland Seres <roland.seres90@gmail.com>
This commit is contained in:
Bálint Ujvári
2026-03-19 16:03:25 +01:00
parent 55e7879849
commit 855a017033
5 changed files with 334 additions and 290 deletions
@@ -1,4 +1,4 @@
import React, { ReactElement } from 'react'
import React, { ReactElement, useLayoutEffect, useState } from 'react'
import { createPortal } from 'react-dom'
import { Button } from '../Button/Button'
@@ -35,7 +35,11 @@ export function ConfirmModal({
onMinimize,
background = true,
}: ConfirmModalProps): ReactElement {
const modalRoot = document.querySelector('.fm-main') || document.body
const [modalRoot, setModalRoot] = useState<Element>(() => document.querySelector('.fm-main') || document.body)
useLayoutEffect(() => {
setModalRoot(document.querySelector('.fm-main') || document.body)
}, [])
return createPortal(
<div className={`fm-modal-container fm-confirm-modal ${background ? '' : 'fm-modal-no-background'}`}>