File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ var NativeAppEventEmitter = require('react-native').NativeAppEventEmitter; // i
1313var DeviceEventEmitter = require ( 'react-native' ) . DeviceEventEmitter ; // Android
1414var base64 = require ( 'base-64' ) ;
1515var utf8 = require ( 'utf8' ) ;
16+ var isIOS = require ( 'react-native' ) . Platform . OS === 'ios' ;
1617
1718var RNFSFileTypeRegular = RNFSManager . RNFSFileTypeRegular ;
1819var RNFSFileTypeDirectory = RNFSManager . RNFSFileTypeDirectory ;
@@ -503,10 +504,14 @@ var RNFS = {
503504 touch ( filepath : string , mtime ? : Date , ctime ? : Date ) : Promise < void > {
504505 if ( ctime && ! ( ctime instanceof Date ) ) throw new Error ( 'touch: Invalid value for argument `ctime`' ) ;
505506 if ( mtime && ! ( mtime instanceof Date ) ) throw new Error ( 'touch: Invalid value for argument `mtime`' ) ;
507+ var ctimeTime = 0 ;
508+ if ( isIOS ) {
509+ ctimeTime = ctime && ctime . getTime ( ) ;
510+ }
506511 return RNFSManager . touch (
507512 normalizeFilePath ( filepath ) ,
508513 mtime && mtime . getTime ( ) ,
509- ctime && ctime . getTime ( )
514+ ctimeTime
510515 ) ;
511516 } ,
512517
You can’t perform that action at this time.
0 commit comments