File tree 1 file changed +3
-2
lines changed
lib/services/livesync/playground
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { PubnubKeys } from "./preview-app-constants";
3
3
const pako = require ( "pako" ) ;
4
4
5
5
export class PreviewSdkService implements IPreviewSdkService {
6
- private static MAX_FILES_UPLOAD_BYTE_LENGTH = 30000 ;
6
+ private static MAX_FILES_UPLOAD_BYTE_LENGTH = 15 * 1024 * 1024 ; // In MBs
7
7
private messagingService : MessagingService = null ;
8
8
private instanceId : string = null ;
9
9
public connectedDevices : Device [ ] = [ ] ;
@@ -76,7 +76,8 @@ export class PreviewSdkService implements IPreviewSdkService {
76
76
onSendingChange : ( sending : boolean ) => ( { } ) ,
77
77
onBiggerFilesUpload : async ( filesContent , callback ) => {
78
78
const gzippedContent = Buffer . from ( pako . gzip ( filesContent ) ) ;
79
- const byteLength = gzippedContent . byteLength ;
79
+ const byteLength = filesContent . length ;
80
+
80
81
if ( byteLength > PreviewSdkService . MAX_FILES_UPLOAD_BYTE_LENGTH ) {
81
82
this . $logger . warn ( "The files to upload exceed the maximum allowed size of 15MB. Your app might not work as expected." ) ;
82
83
}
You can’t perform that action at this time.
0 commit comments