add collection should not be hidden check
This commit is contained in:
parent
19544abdcb
commit
5cec42206c
|
@ -18,6 +18,8 @@ import { SetFiles } from 'types/gallery';
|
|||
import { MAX_TRASH_BATCH_SIZE } from 'constants/file';
|
||||
import { BulkUpdateMagicMetadataRequest } from 'types/magicMetadata';
|
||||
import { addLogLine } from 'utils/logging';
|
||||
import { isCollectionHidden } from 'utils/collection';
|
||||
import { CustomError } from 'utils/error';
|
||||
|
||||
const ENDPOINT = getEndpoint();
|
||||
const FILES_TABLE = 'files';
|
||||
|
@ -63,6 +65,9 @@ export const syncFiles = async (
|
|||
if (!getToken()) {
|
||||
continue;
|
||||
}
|
||||
if (isCollectionHidden(collection)) {
|
||||
throw CustomError.HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED;
|
||||
}
|
||||
const lastSyncTime = await getCollectionLastSyncTime(collection);
|
||||
if (collection.updationTime === lastSyncTime) {
|
||||
continue;
|
||||
|
|
|
@ -47,6 +47,7 @@ export enum CustomError {
|
|||
INCORRECT_PASSWORD = 'incorrect password',
|
||||
UPLOAD_CANCELLED = 'upload cancelled',
|
||||
REQUEST_TIMEOUT = 'request taking too long',
|
||||
HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED = 'hidden collection sync file attempted',
|
||||
}
|
||||
|
||||
function parseUploadErrorCodes(error) {
|
||||
|
|
Loading…
Reference in a new issue