Skip to content

Conversation

@kajarosz
Copy link
Contributor

@kajarosz kajarosz commented Feb 11, 2025

Check if file is bigger that 1MB and pass isLargeFileto MetadataInstanceForm so that Large File Warning Inline Notice can be displayed.

iaLargeFileTest

@kajarosz kajarosz marked this pull request as ready for review February 13, 2025 12:33
@kajarosz kajarosz requested review from a team as code owners February 13, 2025 12:33
import { type BoxItem } from '../../../common/types/core';

export function isFileLargerThan(file: BoxItem, breakpoint: number): boolean {
return file ? file.size > breakpoint : false;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: file is required param so maybe you dont need the ternary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tjuanitas I've adjusted typing here - file can also be null is useSidebarMetadataFetcher is still processing, so we need to take care of this scenario here.

wpiesiak
wpiesiak previously approved these changes Feb 17, 2025
jankowiakdawid
jankowiakdawid previously approved these changes Feb 17, 2025
@mergify mergify bot merged commit 26d516d into box:master Feb 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants