Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import DriveItemInfoMenu from 'app/drive/components/DriveItemInfoMenu/DriveItemI
import { getAppConfig } from 'services/config.service';
import ShareItemDialog from '../../../../views/Shared/components/ShareItemDialog/ShareItemDialog';
import { Sidebar as VersionHistorySidebar } from '../../../../views/Drive/components/VersionHistory';
import ReachedFileSizeLimitDialog from 'app/drive/components/ReachedFileSizeLimitDialog';

export interface HeaderAndSidenavLayoutProps {
children: JSX.Element;
Expand All @@ -23,6 +24,7 @@ export default function HeaderAndSidenavLayout(props: HeaderAndSidenavLayoutProp
const itemToShare = useAppSelector((state) => state.storage.itemToShare);
const isShareItemDialogOpen = useAppSelector((state) => state.ui.isShareItemDialogOpen);
const isReachedPlanLimitDialogOpen = useAppSelector((state) => state.ui.isReachedPlanLimitDialogOpen);
const isReachedFileSizeLImitDialogOpen = useAppSelector((state) => state.ui.isReachedFileSizeLimitDialogOpen);
const isDriveItemInfoMenuOpen = useAppSelector((state) => state.ui.isDriveItemInfoMenuOpen);
const driveItemInfo = useAppSelector((state) => state.ui.currentFileInfoMenuItem);
const onDriveItemInfoMenuClosed = () => {
Expand All @@ -40,7 +42,7 @@ export default function HeaderAndSidenavLayout(props: HeaderAndSidenavLayoutProp
<div className="flex h-auto min-h-full flex-col">
{isShareItemDialogOpen && itemToShare && <ShareItemDialog share={itemToShare?.share} item={itemToShare.item} />}
{isReachedPlanLimitDialogOpen && <ReachedPlanLimitDialog />}
{/* <ReachedFileSizeLimitDialog /> */}
{isReachedFileSizeLImitDialogOpen && <ReachedFileSizeLimitDialog />}

<div className="flex h-1 grow">
<Sidenav />
Expand Down
13 changes: 12 additions & 1 deletion src/app/drive/components/ReachedFileSizeLimitDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { fetchPlanPrices } from 'views/NewSettings/services/plansApi';
import { Translate } from 'app/i18n/types';
import { bytesToString } from '../../services/size.service';
import { fileVersionsSelectors } from 'app/store/slices/fileVersions';
import notificationsService, { ToastType } from 'app/notifications/services/notifications.service';

const ReachedFileSizeLimitDialog = (): JSX.Element | null => {
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -96,7 +97,17 @@ const ReachedFileSizeLimitDialog = (): JSX.Element | null => {
'5TB': translate('error.fileSizeLimitExceeded.planList.ultimate'),
};

if (!isOpen) return null;
useEffect(() => {
if (isOpen && availablePlans.length > 0 && !nextPlan) {
notificationsService.show({
text: translate('notificationMessages.reachedFileSizeLimit'),
type: ToastType.Warning,
});
onClose();
}
}, [isOpen, availablePlans.length, nextPlan]);

if (!isOpen || !nextPlan) return null;

return (
<div className="absolute bottom-0 left-0 right-0 top-0 z-50 flex bg-black/40">
Expand Down
2 changes: 1 addition & 1 deletion src/app/drive/services/network.service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createWorkerMessageHandlerPromise } from '../worker.service/uploadWorke
import { notifyUserWithCooldown } from 'app/core/factory/sdk/retryStrategies';
import { EnvironmentConfig, IUploadParams } from './types';

export const MAX_ALLOWED_UPLOAD_SIZE = 40 * 1024 * 1024 * 1024;
export const MAX_ALLOWED_UPLOAD_SIZE = 10 * 1024 * 1024 * 1024;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is 10 now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the essential plan has 10 GB (the smaller plan). If a user does not have tier, he should not have a bigger Upload Size Limit.


export class Network {
private mnemonic: string;
Expand Down
6 changes: 1 addition & 5 deletions src/app/network/UploadFolderManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { logNetworkInfoForUpload } from './networkInformation';
import { uiActions } from 'app/store/slices/ui';
import { FilesExceedsSizeLimitError } from 'app/drive/services/file.service/upload.errors';
import { filterFilesByMaxSize } from 'app/store/slices/storage/fileUtils/filterFilesByMaxSize';
import notificationsService, { ToastType } from 'app/notifications/services/notifications.service';

interface UploadFolderPayload {
root: IRoot;
Expand Down Expand Up @@ -258,10 +257,7 @@ export class UploadFoldersManager {
if (allFilesExceedSizeLimit && hasNoChildFolders) {
await this.stopUploadTask(taskId, abortController);
this.killQueueAndNotifyError(taskId);
notificationsService.show({
text: t('notificationMessages.reachedFileSizeLimit'),
type: ToastType.Warning,
});

this.dispatch(
uiActions.setOpenFileSizeLimitReachedDialog({ open: true, info: { exceededFiles: level.childrenFiles } }),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ export const uploadFolderThunk = createAsyncThunk<void, UploadFolderThunkPayload

if (allFilesExceedSizeLimit && hasNoChildFolders) {
await stopUploadTask(uploadFolderAbortController, dispatch, taskId, rootFolderItem);
notificationsService.show({
text: t('notificationMessages.reachedFileSizeLimit'),
type: ToastType.Warning,
});

dispatch(
uiActions.setOpenFileSizeLimitReachedDialog({ open: true, info: { exceededFiles: level.childrenFiles } }),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ const validateFileSize = (
const { allowedFilesToUpload, exceededFiles } = filterFilesByMaxSize({ files, maxUploadFileSize });

if (exceededFiles.length > 0) {
notificationsService.show({
text: t('notificationMessages.reachedFileSizeLimit'),
type: ToastType.Warning,
});
openReachedFileSizeLimitDialog(exceededFiles, dispatch);
}

Expand Down
Loading