@@ -8,6 +8,7 @@ import { initServerSideAuth } from '$lib/services/backends/shared/auth';
88import { createCommitMessage } from '$lib/services/backends/shared/commits' ;
99import { fetchAndParseFiles } from '$lib/services/backends/shared/data' ;
1010import { siteConfig } from '$lib/services/config' ;
11+ import { dataLoadedProgress } from '$lib/services/contents' ;
1112import { user } from '$lib/services/user' ;
1213import { sendRequest } from '$lib/services/utils/networking' ;
1314
@@ -393,6 +394,13 @@ const fetchFileContents = async (fetchingFiles) => {
393394 ` ;
394395 } ;
395396
397+ dataLoadedProgress . set ( 0 ) ;
398+
399+ // Show a fake progressbar because the request waiting time is long
400+ const dataLoadedProgressInterval = window . setInterval ( ( ) => {
401+ dataLoadedProgress . update ( ( progress = 0 ) => progress + 1 ) ;
402+ } , fetchingFileList . length / 10 ) ;
403+
396404 for ( let i = 0 ; i < fetchingFileList . length ; i += chunkSize ) {
397405 chunks . push ( fetchingFileList . slice ( i , i + chunkSize ) ) ;
398406 }
@@ -411,6 +419,9 @@ const fetchFileContents = async (fetchingFiles) => {
411419 } ) ,
412420 ) ;
413421
422+ window . clearInterval ( dataLoadedProgressInterval ) ;
423+ dataLoadedProgress . set ( undefined ) ;
424+
414425 return Object . fromEntries (
415426 fetchingFiles . map ( ( { path, sha, size } , index ) => {
416427 const {
0 commit comments