@@ -239,10 +239,6 @@ export class Metadata implements IMetadata {
239
239
return this . native . getBucket ?.( ) ;
240
240
}
241
241
242
- get cacheControl ( ) : string {
243
- return this . native . getCacheControl ?.( ) ;
244
- }
245
-
246
242
private _createBuilder ( ) {
247
243
if ( this . _native ) {
248
244
this . _builder = new com . google . firebase . storage . StorageMetadata . Builder ( this . _native ) ;
@@ -251,6 +247,10 @@ export class Metadata implements IMetadata {
251
247
}
252
248
}
253
249
250
+ get cacheControl ( ) : string {
251
+ return this . native . getCacheControl ?.( ) ;
252
+ }
253
+
254
254
set cacheControl ( value ) {
255
255
if ( ! this . _builder ) {
256
256
this . _createBuilder ( ) ;
@@ -510,16 +510,18 @@ export class Reference implements IReference {
510
510
putString ( data : string , format : StringFormat = StringFormat . RAW , metadata ?: Metadata ) : Task {
511
511
switch ( format ) {
512
512
case StringFormat . DATA_URL :
513
- const base64 = b64WithoutPrefix ( data ) ;
514
- const mime = getMIMEforBase64String ( data ) ;
515
-
516
- const meta = metadata || new Metadata ( ) ;
517
- if ( ! metadata . contentType ) {
518
- meta . contentType = mime ;
519
- }
513
+ {
514
+ const base64 = b64WithoutPrefix ( data ) ;
515
+ const mime = getMIMEforBase64String ( data ) ;
520
516
521
- org . nativescript . firebase . storage . FirebaseStorage . StorageReference . putString ( this . native , base64 , format , meta . native ) ;
517
+ const meta = metadata || new Metadata ( ) ;
518
+ if ( ! metadata . contentType ) {
519
+ meta . contentType = mime ;
520
+ }
522
521
522
+ org . nativescript . firebase . storage . FirebaseStorage . StorageReference . putString ( this . native , base64 , format , meta . native ) ;
523
+ }
524
+ break ;
523
525
default :
524
526
return Task . fromNative ( org . nativescript . firebase . storage . FirebaseStorage . StorageReference . putString ( this . native , data , format , metadata ?. native || null ) ) ;
525
527
}
0 commit comments