Merge pull request #839 from ente-io/fix-password-locked-public-collection-upload
fix password locked public collection upload
This commit is contained in:
commit
d68019a934
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -50,7 +50,7 @@ class UploadService {
|
|||
|
||||
private publicUploadProps: PublicUploadProps = undefined;
|
||||
|
||||
setPublicUploadProps(publicUploadProps: PublicUploadProps) {
|
||||
init(publicUploadProps: PublicUploadProps) {
|
||||
this.publicUploadProps = publicUploadProps;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue