Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add check
Signed-off-by: Milen Pivchev <[email protected]>
  • Loading branch information
mpivchev committed Jul 19, 2023
commit 191d401b1d243f09553df5340a110a10b24079ce
2 changes: 1 addition & 1 deletion iOSClient/Settings/CCAdvanced.m
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor ol
if ([rowDescriptor.tag isEqualToString:@"chunk"]) {
NSInteger chunkSize = [[rowDescriptor.value valueData] intValue];
XLFormRowDescriptor *row;

row = [XLFormRowDescriptor formRowDescriptorWithTag:@"chunk" rowType:XLFormRowDescriptorTypeStepCounter title:NSLocalizedString(@"_chunk_size_mb_", nil)];

if (chunkSize > 100) {
Expand Down
4 changes: 4 additions & 0 deletions iOSClient/Utility/CCUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ + (void)setAccountRequest:(BOOL)set
[UICKeyChainStore setString:sSet forKey:@"accountRequest" service:NCGlobal.shared.serviceShareKeyChain];
}

/// In megabytes (MB)
+ (NSInteger)getChunkSize
{
NSString *size = [UICKeyChainStore stringForKey:@"chunkSize" service:NCGlobal.shared.serviceShareKeyChain];
Expand All @@ -678,8 +679,11 @@ + (NSInteger)getChunkSize
}
}

/// In megabytes (MB)
+ (void)setChunkSize:(NSInteger)size
{
if (size < 10) size = 0;
Copy link
Member

Choose a reason for hiding this comment

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

I think the size should still be default to the minimum supported value of 5MB then if configured to be > 0.

Maybe there is some byte calculation in another place where the 5 MB -> bytes generates the wrong value?

Copy link
Member

Choose a reason for hiding this comment

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

We can remove this two function and use the new algorithm


NSString *sizeString = [@(size) stringValue];
[UICKeyChainStore setString:sizeString forKey:@"chunkSize" service:NCGlobal.shared.serviceShareKeyChain];
}
Expand Down