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 { MAX_TRASH_BATCH_SIZE } from 'constants/file';
|
||||||
import { BulkUpdateMagicMetadataRequest } from 'types/magicMetadata';
|
import { BulkUpdateMagicMetadataRequest } from 'types/magicMetadata';
|
||||||
import { addLogLine } from 'utils/logging';
|
import { addLogLine } from 'utils/logging';
|
||||||
|
import { isCollectionHidden } from 'utils/collection';
|
||||||
|
import { CustomError } from 'utils/error';
|
||||||
|
|
||||||
const ENDPOINT = getEndpoint();
|
const ENDPOINT = getEndpoint();
|
||||||
const FILES_TABLE = 'files';
|
const FILES_TABLE = 'files';
|
||||||
|
@ -63,6 +65,9 @@ export const syncFiles = async (
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (isCollectionHidden(collection)) {
|
||||||
|
throw CustomError.HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED;
|
||||||
|
}
|
||||||
const lastSyncTime = await getCollectionLastSyncTime(collection);
|
const lastSyncTime = await getCollectionLastSyncTime(collection);
|
||||||
if (collection.updationTime === lastSyncTime) {
|
if (collection.updationTime === lastSyncTime) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -47,6 +47,7 @@ export enum CustomError {
|
||||||
INCORRECT_PASSWORD = 'incorrect password',
|
INCORRECT_PASSWORD = 'incorrect password',
|
||||||
UPLOAD_CANCELLED = 'upload cancelled',
|
UPLOAD_CANCELLED = 'upload cancelled',
|
||||||
REQUEST_TIMEOUT = 'request taking too long',
|
REQUEST_TIMEOUT = 'request taking too long',
|
||||||
|
HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED = 'hidden collection sync file attempted',
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseUploadErrorCodes(error) {
|
function parseUploadErrorCodes(error) {
|
||||||
|
|
Loading…
Reference in a new issue