diff --git a/src/components/Upload/Uploader.tsx b/src/components/Upload/Uploader.tsx index 5c0d93cbf..90dadcf81 100644 --- a/src/components/Upload/Uploader.tsx +++ b/src/components/Upload/Uploader.tsx @@ -177,7 +177,11 @@ export default function Uploader(props: Props) { appContext.setIsFolderSyncRunning ); } - }, []); + }, [ + publicCollectionGalleryContext.accessedThroughSharedURL, + publicCollectionGalleryContext.token, + publicCollectionGalleryContext.passwordToken, + ]); // this handles the change of selectorFiles changes on web when user selects // files for upload through the opened file/folder selector or dragAndDrop them diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index 916cfbb05..0c7410753 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -169,6 +169,9 @@ export default function PublicCollectionGallery() { ); if (localCollection) { setPublicCollection(localCollection); + const isPasswordProtected = + localCollection?.publicURLs?.[0]?.passwordEnabled; + setIsPasswordProtected(isPasswordProtected); const collectionUID = getPublicCollectionUID(token.current); const localFiles = await getLocalPublicFiles(collectionUID); const localPublicFiles = sortFiles( @@ -229,6 +232,7 @@ export default function PublicCollectionGallery() { const collectionUID = getPublicCollectionUID(token.current); try { appContext.startLoading(); + setLoading(true); const collection = await getPublicCollection( token.current, collectionKey.current @@ -291,6 +295,7 @@ export default function PublicCollectionGallery() { } } finally { appContext.finishLoading(); + setLoading(false); } }; diff --git a/src/services/upload/uploadManager.ts b/src/services/upload/uploadManager.ts index 92fb39c55..f92dc7a37 100644 --- a/src/services/upload/uploadManager.ts +++ b/src/services/upload/uploadManager.ts @@ -62,6 +62,7 @@ class UploadManager { publicCollectProps: PublicUploadProps ) { UIService.init(progressUpdater); + UploadService.init(publicCollectProps); this.setFiles = setFiles; this.publicUploadProps = publicCollectProps; } @@ -261,7 +262,6 @@ class UploadManager { UIService.reset(mediaFiles.length); - UploadService.setPublicUploadProps(this.publicUploadProps); await UploadService.setFileCount(mediaFiles.length); UIService.setUploadStage(UPLOAD_STAGES.UPLOADING); diff --git a/src/services/upload/uploadService.ts b/src/services/upload/uploadService.ts index d066858ca..3b50396c1 100644 --- a/src/services/upload/uploadService.ts +++ b/src/services/upload/uploadService.ts @@ -50,7 +50,7 @@ class UploadService { private publicUploadProps: PublicUploadProps = undefined; - setPublicUploadProps(publicUploadProps: PublicUploadProps) { + init(publicUploadProps: PublicUploadProps) { this.publicUploadProps = publicUploadProps; }