1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 08:28:11 +00:00

fix: metadata load tip (#7103)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-11-26 12:25:53 +08:00
committed by GitHub
parent 03fd3b8f55
commit ece36d36f5
7 changed files with 50 additions and 26 deletions

View File

@@ -21,7 +21,7 @@ export const MetadataViewProvider = ({
const [errorMessage, setErrorMessage] = useState(null);
const storeRef = useRef(null);
const { collaborators } = useCollaborators();
const { isEmptyRepo, showFirstView, setShowFirstView } = useMetadata();
const { isBeingBuilt, setIsBeingBuilt } = useMetadata();
const tableChanged = useCallback(() => {
setMetadata(storeRef.current.data);
@@ -85,9 +85,9 @@ export const MetadataViewProvider = ({
storeRef.current = new Store({ context: window.sfMetadataContext, repoId: repoID, viewId: viewID, collaborators });
window.sfMetadataStore = storeRef.current;
storeRef.current.initStartIndex();
storeRef.current.load(PER_LOAD_NUMBER, isEmptyRepo).then(() => {
storeRef.current.load(PER_LOAD_NUMBER, isBeingBuilt).then(() => {
setMetadata(storeRef.current.data);
setShowFirstView(false);
setIsBeingBuilt(false);
setLoading(false);
}).catch(error => {
const errorMsg = Utils.getErrorMsg(error);
@@ -132,7 +132,7 @@ export const MetadataViewProvider = ({
<MetadataViewContext.Provider
value={{
isLoading,
showFirstView,
isBeingBuilt,
errorMessage,
metadata,
store: storeRef.current,