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
|
appContext.setIsFolderSyncRunning
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, []);
|
}, [
|
||||||
|
publicCollectionGalleryContext.accessedThroughSharedURL,
|
||||||
|
publicCollectionGalleryContext.token,
|
||||||
|
publicCollectionGalleryContext.passwordToken,
|
||||||
|
]);
|
||||||
|
|
||||||
// this handles the change of selectorFiles changes on web when user selects
|
// this handles the change of selectorFiles changes on web when user selects
|
||||||
// files for upload through the opened file/folder selector or dragAndDrop them
|
// files for upload through the opened file/folder selector or dragAndDrop them
|
||||||
|
|
|
@ -169,6 +169,9 @@ export default function PublicCollectionGallery() {
|
||||||
);
|
);
|
||||||
if (localCollection) {
|
if (localCollection) {
|
||||||
setPublicCollection(localCollection);
|
setPublicCollection(localCollection);
|
||||||
|
const isPasswordProtected =
|
||||||
|
localCollection?.publicURLs?.[0]?.passwordEnabled;
|
||||||
|
setIsPasswordProtected(isPasswordProtected);
|
||||||
const collectionUID = getPublicCollectionUID(token.current);
|
const collectionUID = getPublicCollectionUID(token.current);
|
||||||
const localFiles = await getLocalPublicFiles(collectionUID);
|
const localFiles = await getLocalPublicFiles(collectionUID);
|
||||||
const localPublicFiles = sortFiles(
|
const localPublicFiles = sortFiles(
|
||||||
|
@ -229,6 +232,7 @@ export default function PublicCollectionGallery() {
|
||||||
const collectionUID = getPublicCollectionUID(token.current);
|
const collectionUID = getPublicCollectionUID(token.current);
|
||||||
try {
|
try {
|
||||||
appContext.startLoading();
|
appContext.startLoading();
|
||||||
|
setLoading(true);
|
||||||
const collection = await getPublicCollection(
|
const collection = await getPublicCollection(
|
||||||
token.current,
|
token.current,
|
||||||
collectionKey.current
|
collectionKey.current
|
||||||
|
@ -291,6 +295,7 @@ export default function PublicCollectionGallery() {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
appContext.finishLoading();
|
appContext.finishLoading();
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ class UploadManager {
|
||||||
publicCollectProps: PublicUploadProps
|
publicCollectProps: PublicUploadProps
|
||||||
) {
|
) {
|
||||||
UIService.init(progressUpdater);
|
UIService.init(progressUpdater);
|
||||||
|
UploadService.init(publicCollectProps);
|
||||||
this.setFiles = setFiles;
|
this.setFiles = setFiles;
|
||||||
this.publicUploadProps = publicCollectProps;
|
this.publicUploadProps = publicCollectProps;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +262,6 @@ class UploadManager {
|
||||||
|
|
||||||
UIService.reset(mediaFiles.length);
|
UIService.reset(mediaFiles.length);
|
||||||
|
|
||||||
UploadService.setPublicUploadProps(this.publicUploadProps);
|
|
||||||
await UploadService.setFileCount(mediaFiles.length);
|
await UploadService.setFileCount(mediaFiles.length);
|
||||||
|
|
||||||
UIService.setUploadStage(UPLOAD_STAGES.UPLOADING);
|
UIService.setUploadStage(UPLOAD_STAGES.UPLOADING);
|
||||||
|
|
|
@ -50,7 +50,7 @@ class UploadService {
|
||||||
|
|
||||||
private publicUploadProps: PublicUploadProps = undefined;
|
private publicUploadProps: PublicUploadProps = undefined;
|
||||||
|
|
||||||
setPublicUploadProps(publicUploadProps: PublicUploadProps) {
|
init(publicUploadProps: PublicUploadProps) {
|
||||||
this.publicUploadProps = publicUploadProps;
|
this.publicUploadProps = publicUploadProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue