Skip to content

Commit

Permalink
Merge branch 'dev-v2.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
birdofpreyru committed Nov 16, 2024
2 parents 5df8019 + b70823e commit e8fe2ad
Show file tree
Hide file tree
Showing 15 changed files with 989 additions and 1,252 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.18.0
v22.11.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ with an error.
```ts
function stopUpload(jobId: number): void;
```
**VERIFIED:** iOS.
**VERIFIED:** iOS. **NOT SUPPORTED**: Android, Windows.

iOS only. Abort the current upload job with given ID.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
constants["PicturesDirectoryPath"] = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).absolutePath
constants["CachesDirectoryPath"] = this.reactApplicationContext.cacheDir.absolutePath
constants["DownloadDirectoryPath"] = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath
constants["FileTypeRegular"] = 0
constants["FileTypeDirectory"] = 1
constants["FileTypeRegular"] = "0"
constants["FileTypeDirectory"] = "1"
constants["ExternalStorageDirectoryPath"] = Environment.getExternalStorageDirectory()?.absolutePath
constants["ExternalDirectoryPath"] = this.reactApplicationContext.getExternalFilesDir(null)?.absolutePath
constants["ExternalCachesDirectoryPath"] = this.reactApplicationContext.externalCacheDir?.absolutePath
Expand Down Expand Up @@ -172,7 +172,10 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
// If the queue has drained, it is success, we are done.
if (queue.isEmpty()) return promise.resolve(null)

val next = queue.removeAt(queue.size - 1)
val next =
if (Build.VERSION.SDK_INT >= 35) queue.removeLast()
else queue.removeAt(queue.size - 1)

currentFrom = next.first
currentInto = next.second
}
Expand Down Expand Up @@ -526,7 +529,7 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
fileMap.putString("name", childFile.name)
fileMap.putString("path", childFile.absolutePath)
fileMap.putDouble("size", childFile.length().toDouble())
fileMap.putInt("type", if (childFile.isDirectory) 1 else 0)
fileMap.putString("type", if (childFile.isDirectory) "1" else "0")
fileMaps.pushMap(fileMap)
}
promise.resolve(fileMaps)
Expand Down Expand Up @@ -559,7 +562,7 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
isDirectory = !ex.message!!.contains("compressed")
}
fileMap.putInt("size", length)
fileMap.putInt("type", if (isDirectory) 1 else 0) // if 0, probably a folder..
fileMap.putString("type", if (isDirectory) "1" else "0") // if 0, probably a folder..
fileMaps.pushMap(fileMap)
}
promise.resolve(fileMaps)
Expand Down Expand Up @@ -673,7 +676,7 @@ class ReactNativeFsModule internal constructor(context: ReactApplicationContext)
statMap.putInt("ctime", (file.lastModified() / 1000).toInt())
statMap.putInt("mtime", (file.lastModified() / 1000).toInt())
statMap.putDouble("size", file.length().toDouble())
statMap.putInt("type", if (file.isDirectory) 1 else 0)
statMap.putString("type", if (file.isDirectory) "1" else "0")
statMap.putString("originalFilepath", originalFilepath)
promise.resolve(statMap)
} catch (ex: Exception) {
Expand Down
1 change: 1 addition & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e8fe2ad

Please sign in to comment.