Hooks: Added loaded command for public room fetch data

This commit is contained in:
Ilya Oleshko 2024-02-01 15:15:28 +03:00
parent 8c0fd10645
commit 684951f0ae

View File

@ -1,6 +1,7 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import axios from "axios"; import axios from "axios";
import FilesFilter from "@docspace/common/api/files/filter"; import FilesFilter from "@docspace/common/api/files/filter";
import { frameCallCommand } from "@docspace/common/utils";
const usePublic = ({ roomId, location, fetchFiles, setIsLoading }) => { const usePublic = ({ roomId, location, fetchFiles, setIsLoading }) => {
useEffect(() => { useEffect(() => {
@ -60,6 +61,7 @@ const usePublic = ({ roomId, location, fetchFiles, setIsLoading }) => {
}) })
.finally(() => { .finally(() => {
setIsLoading(false); setIsLoading(false);
frameCallCommand("setIsLoaded");
}); });
}, [location.pathname, location.search]); }, [location.pathname, location.search]);
}; };