Fix cast build errors
This commit is contained in:
parent
d94ea221c7
commit
17caa99416
4 changed files with 8 additions and 68 deletions
|
@ -143,20 +143,11 @@ class CastDownloadManager {
|
|||
return decrypted;
|
||||
};
|
||||
|
||||
getFile = async (
|
||||
file: EnteFile,
|
||||
token: string,
|
||||
passwordToken: string,
|
||||
forPreview = false
|
||||
) => {
|
||||
getFile = async (file: EnteFile, castToken: string, forPreview = false) => {
|
||||
const fileKey = forPreview ? `${file.id}_preview` : `${file.id}`;
|
||||
try {
|
||||
const getFilePromise = async () => {
|
||||
const fileStream = await this.downloadFile(
|
||||
token,
|
||||
passwordToken,
|
||||
file
|
||||
);
|
||||
const fileStream = await this.downloadFile(castToken, file);
|
||||
const fileBlob = await new Response(fileStream).blob();
|
||||
if (forPreview) {
|
||||
return await getRenderableFileURL(file, fileBlob);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// import { CollectionDownloadProgressAttributes } from 'components/Collections/CollectionDownloadProgress';
|
||||
// import { CollectionSelectorAttributes } from 'components/Collections/CollectionSelector';
|
||||
// import { TimeStampListItem } from 'components/PhotoList';
|
||||
import { User } from '@ente/shared/user/types';
|
||||
import { Collection } from 'types/collection';
|
||||
import { EnteFile } from 'types/file';
|
||||
import { User } from 'types/user';
|
||||
|
||||
export type SelectedState = {
|
||||
[k: number]: boolean;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import {
|
||||
B64EncryptionResult,
|
||||
LocalFileAttributes,
|
||||
} from '@ente/shared/crypto/types';
|
||||
import { FILE_TYPE } from 'constants/file';
|
||||
import { Collection } from 'types/collection';
|
||||
import { B64EncryptionResult, LocalFileAttributes } from 'types/crypto';
|
||||
import {
|
||||
MetadataFileAttributes,
|
||||
S3FileAttributes,
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
import {
|
||||
getNonEmptyCollections,
|
||||
updatePublicCollectionMagicMetadata,
|
||||
} from 'services/collectionService';
|
||||
import { EnteFile } from 'types/file';
|
||||
import { logError } from '@ente/shared/sentry';
|
||||
import {
|
||||
COLLECTION_ROLE,
|
||||
Collection,
|
||||
CollectionPublicMagicMetadataProps,
|
||||
} from 'types/collection';
|
||||
import { COLLECTION_ROLE, Collection } from 'types/collection';
|
||||
import {
|
||||
CollectionSummaryType,
|
||||
CollectionType,
|
||||
|
@ -16,7 +6,6 @@ import {
|
|||
OPTIONS_NOT_HAVING_COLLECTION_TYPES,
|
||||
} from 'constants/collection';
|
||||
import { SUB_TYPE, VISIBILITY_STATE } from 'types/magicMetadata';
|
||||
import { updateMagicMetadata } from 'utils/magicMetadata';
|
||||
import { User } from '@ente/shared/user/types';
|
||||
import { getData, LS_KEYS } from '@ente/shared/storage/localStorage';
|
||||
|
||||
|
@ -35,31 +24,6 @@ export function getSelectedCollection(
|
|||
return collections.find((collection) => collection.id === collectionID);
|
||||
}
|
||||
|
||||
export const changeCollectionSortOrder = async (
|
||||
collection: Collection,
|
||||
asc: boolean
|
||||
) => {
|
||||
try {
|
||||
const updatedPublicMagicMetadataProps: CollectionPublicMagicMetadataProps =
|
||||
{
|
||||
asc,
|
||||
};
|
||||
|
||||
const updatedPubMagicMetadata = await updateMagicMetadata(
|
||||
updatedPublicMagicMetadataProps,
|
||||
collection.pubMagicMetadata,
|
||||
collection.key
|
||||
);
|
||||
|
||||
await updatePublicCollectionMagicMetadata(
|
||||
collection,
|
||||
updatedPubMagicMetadata
|
||||
);
|
||||
} catch (e) {
|
||||
logError(e, 'change collection sort order failed');
|
||||
}
|
||||
};
|
||||
|
||||
export const shouldShowOptions = (type: CollectionSummaryType) => {
|
||||
return !OPTIONS_NOT_HAVING_COLLECTION_TYPES.has(type);
|
||||
};
|
||||
|
@ -172,24 +136,6 @@ export function getCollectionNameMap(
|
|||
);
|
||||
}
|
||||
|
||||
export function getNonEmptyPersonalCollections(
|
||||
collections: Collection[],
|
||||
personalFiles: EnteFile[],
|
||||
user: User
|
||||
): Collection[] {
|
||||
if (!user?.id) {
|
||||
throw Error('user missing');
|
||||
}
|
||||
const nonEmptyCollections = getNonEmptyCollections(
|
||||
collections,
|
||||
personalFiles
|
||||
);
|
||||
const personalCollections = nonEmptyCollections.filter(
|
||||
(collection) => collection.owner.id === user?.id
|
||||
);
|
||||
return personalCollections;
|
||||
}
|
||||
|
||||
export function getNonHiddenCollections(
|
||||
collections: Collection[]
|
||||
): Collection[] {
|
||||
|
|
Loading…
Add table
Reference in a new issue