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
13
13
var DeviceEventEmitter = require ( 'react-native' ) . DeviceEventEmitter ; // Android
14
14
var base64 = require ( 'base-64' ) ;
15
15
var utf8 = require ( 'utf8' ) ;
16
+ var isIOS = require ( 'react-native' ) . Platform . OS === 'ios' ;
16
17
17
18
var RNFSFileTypeRegular = RNFSManager . RNFSFileTypeRegular ;
18
19
var RNFSFileTypeDirectory = RNFSManager . RNFSFileTypeDirectory ;
@@ -503,10 +504,14 @@ var RNFS = {
503
504
touch ( filepath : string , mtime ? : Date , ctime ? : Date ) : Promise < void > {
504
505
if ( ctime && ! ( ctime instanceof Date ) ) throw new Error ( 'touch: Invalid value for argument `ctime`' ) ;
505
506
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
+ }
506
511
return RNFSManager . touch (
507
512
normalizeFilePath ( filepath ) ,
508
513
mtime && mtime . getTime ( ) ,
509
- ctime && ctime . getTime ( )
514
+ ctimeTime
510
515
) ;
511
516
} ,
512
517
You can’t perform that action at this time.
0 commit comments