mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-25 01:52:45 +03:00
fix(Upload): popup not showing bug
This commit is contained in:
parent
1a64e9083c
commit
9fb1e0a181
@ -69,8 +69,7 @@ const useUploadPopup = ({ totalFilesSummary }) => {
|
||||
});
|
||||
|
||||
// NOTE(amine): popup handlers
|
||||
const showUploadPopup = () => setPopupState((prev) => ({ ...prev, isVisible: true }));
|
||||
const hideUploadPopup = () => setPopupState((prev) => ({ ...prev, isVisible: false }));
|
||||
const hideUploadPopup = () => setPopupState({ isSummaryExpanded: false, isVisible: false });
|
||||
const expandUploadSummary = () => setPopupState({ isVisible: true, isSummaryExpanded: true });
|
||||
const collapseUploadSummary = () => setPopupState({ isVisible: true, isSummaryExpanded: false });
|
||||
|
||||
@ -90,6 +89,7 @@ const useUploadPopup = ({ totalFilesSummary }) => {
|
||||
const isSummaryExpandedRef = React.useRef();
|
||||
isSummaryExpandedRef.current = popupState.isSummaryExpanded;
|
||||
React.useEffect(() => {
|
||||
console.log("open", isSummaryExpandedRef.current, totalFilesSummary.total === 0);
|
||||
if (isSummaryExpandedRef.current || totalFilesSummary.total === 0) return;
|
||||
expandUploadSummary();
|
||||
clearTimeout(timeoutRef.current);
|
||||
@ -128,7 +128,6 @@ const useUploadPopup = ({ totalFilesSummary }) => {
|
||||
return [
|
||||
popupState,
|
||||
{
|
||||
showUploadPopup,
|
||||
hideUploadPopup,
|
||||
expandUploadSummary,
|
||||
collapseUploadSummary,
|
||||
|
Loading…
Reference in New Issue
Block a user