@@ -239,10 +239,6 @@ export class Metadata implements IMetadata {
239239 return this . native . getBucket ?.( ) ;
240240 }
241241
242- get cacheControl ( ) : string {
243- return this . native . getCacheControl ?.( ) ;
244- }
245-
246242 private _createBuilder ( ) {
247243 if ( this . _native ) {
248244 this . _builder = new com . google . firebase . storage . StorageMetadata . Builder ( this . _native ) ;
@@ -251,6 +247,10 @@ export class Metadata implements IMetadata {
251247 }
252248 }
253249
250+ get cacheControl ( ) : string {
251+ return this . native . getCacheControl ?.( ) ;
252+ }
253+
254254 set cacheControl ( value ) {
255255 if ( ! this . _builder ) {
256256 this . _createBuilder ( ) ;
@@ -510,16 +510,18 @@ export class Reference implements IReference {
510510 putString ( data : string , format : StringFormat = StringFormat . RAW , metadata ?: Metadata ) : Task {
511511 switch ( format ) {
512512 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 ) ;
520516
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+ }
522521
522+ org . nativescript . firebase . storage . FirebaseStorage . StorageReference . putString ( this . native , base64 , format , meta . native ) ;
523+ }
524+ break ;
523525 default :
524526 return Task . fromNative ( org . nativescript . firebase . storage . FirebaseStorage . StorageReference . putString ( this . native , data , format , metadata ?. native || null ) ) ;
525527 }
0 commit comments