Skip to content

Commit

Permalink
fix naming bug (can't have '/' in names)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Apr 18, 2022
1 parent d9dd669 commit 8f3c9f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ActionSheets.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const BottomBarAddActionSheet = memo(({ navigation, route }) => {

queueFileUpload({
pickedFile: {
name: i18n(lang, getFilePreviewType(getFileExt(fileName)) == "image" ? "photo" : "video") + "_" + new Date().toLocaleString().split(" ").join("_").split(",").join("_").split(":").join("_").split(".").join("_") + "." + getFileExt(fileName),
name: i18n(lang, getFilePreviewType(getFileExt(fileName)) == "image" ? "photo" : "video") + "_" + new Date().toLocaleString().split(" ").join("_").split(",").join("_").split(":").join("_").split(".").join("_").split("/").join(".").split("\\").join("_").split("-").join("_") + "." + getFileExt(fileName),
size: asset.fileSize || typeof stat.size == "string" ? parseInt(stat.size) : stat.size,
type: asset.type || "",
uri: decodeURIComponent(asset.uri) || ""
Expand All @@ -172,7 +172,7 @@ export const BottomBarAddActionSheet = memo(({ navigation, route }) => {
if(err.toString().toLowerCase().indexOf("cancelled") == -1 && err.toString().toLowerCase().indexOf("canceled") == -1){
console.log(err)

reportError(err, "actionSheets:launchImageLibrary:uploadFromGallery")
reportError(err, "actionSheets:launchImageLibrary:launchCamera")

showToast({ message: err.toString() })
}
Expand Down Expand Up @@ -227,7 +227,7 @@ export const BottomBarAddActionSheet = memo(({ navigation, route }) => {

queueFileUpload({
pickedFile: {
name: i18n(lang, getFilePreviewType(getFileExt(fileName)) == "image" ? "photo" : "video") + "_" + new Date(asset.timestamp || (+new Date())).toLocaleString().split(" ").join("_").split(",").join("_").split(":").join("_").split(".").join("_") + "." + getFileExt(fileName),
name: i18n(lang, getFilePreviewType(getFileExt(fileName)) == "image" ? "photo" : "video") + "_" + new Date(asset.timestamp || (+new Date())).toLocaleString().split(" ").join("_").split(",").join("_").split(":").join("_").split(".").join("_").split("/").join(".").split("\\").join("_").split("-").join("_") + "." + getFileExt(fileName),
size: asset.fileSize || typeof stat.size == "string" ? parseInt(stat.size) : stat.size,
type: asset.type || "",
uri: decodeURIComponent(asset.uri) || ""
Expand Down

0 comments on commit 8f3c9f3

Please sign in to comment.