changed the check of collectionSummaryType for share and download quickOptions

This commit is contained in:
Ananddubey01 2023-02-15 21:12:32 +05:30
parent 3523f3bda9
commit 3a3647c06b
2 changed files with 17 additions and 7 deletions

View file

@ -2,7 +2,7 @@ import { CollectionActions } from '..';
import React from 'react'; import React from 'react';
import { CollectionSummaryType } from 'constants/collection'; import { CollectionSummaryType } from 'constants/collection';
import { FlexWrapper } from 'components/Container'; import { FlexWrapper } from 'components/Container';
import { MoveToTrashOption } from './MoveToTrashQuickOption'; import { MoveToTrashOption } from './EmptyTrashQuickOption';
import { DownloadOption } from './DownloadQuickOption'; import { DownloadOption } from './DownloadQuickOption';
import { ShareOption } from './ShareQuickOption'; import { ShareOption } from './ShareQuickOption';
import { import {

View file

@ -199,14 +199,24 @@ export const showTrashQuickOption = (type: CollectionSummaryType) => {
return type === CollectionSummaryType.trash; return type === CollectionSummaryType.trash;
}; };
export const showDownloadQuickOption = (type: CollectionSummaryType) => { export const showDownloadQuickOption = (type: CollectionSummaryType) => {
return !(type === CollectionSummaryType.trash); return (
type === CollectionSummaryType.folder ||
type === CollectionSummaryType.album ||
type === CollectionSummaryType.all ||
type === CollectionSummaryType.incomingShare ||
type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
);
}; };
export const showShareQuickOption = (type: CollectionSummaryType) => { export const showShareQuickOption = (type: CollectionSummaryType) => {
return !( return (
type === CollectionSummaryType.trash || type === CollectionSummaryType.folder ||
type === CollectionSummaryType.favorites || type === CollectionSummaryType.album ||
type === CollectionSummaryType.uncategorized || type === CollectionSummaryType.all ||
type === CollectionSummaryType.incomingShare type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
); );
}; };
export const shouldBeShownOnCollectionBar = (type: CollectionSummaryType) => { export const shouldBeShownOnCollectionBar = (type: CollectionSummaryType) => {