[storage][js][android] make paths consistent - without trailing slashes in `firebase.storage.Native.X` #1200
This commit is contained in:
parent
a8719338c0
commit
9d90a99fb0
|
@ -50,7 +50,7 @@ public class RNFirebaseStorage extends ReactContextBaseJavaModule {
|
|||
private static final String ExternalDirectoryPath = "EXTERNAL_DIRECTORY_PATH";
|
||||
private static final String ExternalStorageDirectoryPath = "EXTERNAL_STORAGE_DIRECTORY_PATH";
|
||||
private static final String PicturesDirectoryPath = "PICTURES_DIRECTORY_PATH";
|
||||
private static final String TemporaryDirectoryPath = "TEMPORARY_DIRECTORY_PATH";
|
||||
private static final String TemporaryDirectoryPath = "TEMP_DIRECTORY_PATH";
|
||||
private static final String CachesDirectoryPath = "CACHES_DIRECTORY_PATH";
|
||||
|
||||
private static final String FileTypeRegular = "FILETYPE_REGULAR";
|
||||
|
@ -684,7 +684,7 @@ public class RNFirebaseStorage extends ReactContextBaseJavaModule {
|
|||
final Map<String, Object> constants = new HashMap<>();
|
||||
|
||||
constants.put(DocumentDirectoryPath, this.getReactApplicationContext().getFilesDir().getAbsolutePath());
|
||||
constants.put(TemporaryDirectoryPath, null);
|
||||
constants.put(TemporaryDirectoryPath, this.getReactApplicationContext().getCacheDir().getAbsolutePath());
|
||||
constants.put(PicturesDirectoryPath, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
|
||||
constants.put(CachesDirectoryPath, this.getReactApplicationContext().getCacheDir().getAbsolutePath());
|
||||
constants.put(FileTypeRegular, 0);
|
||||
|
|
|
@ -7,6 +7,7 @@ import { NativeModules } from 'react-native';
|
|||
import StorageRef from './reference';
|
||||
import { getAppEventName, SharedEventEmitter } from '../../utils/events';
|
||||
import { getLogger } from '../../utils/log';
|
||||
import { stripTrailingSlash } from '../../utils';
|
||||
import ModuleBase from '../../utils/ModuleBase';
|
||||
import { getNativeModule } from '../../utils/native';
|
||||
|
||||
|
@ -149,16 +150,29 @@ export const statics = {
|
|||
},
|
||||
Native: FirebaseStorage
|
||||
? {
|
||||
MAIN_BUNDLE_PATH: FirebaseStorage.MAIN_BUNDLE_PATH,
|
||||
CACHES_DIRECTORY_PATH: FirebaseStorage.CACHES_DIRECTORY_PATH,
|
||||
DOCUMENT_DIRECTORY_PATH: FirebaseStorage.DOCUMENT_DIRECTORY_PATH,
|
||||
EXTERNAL_DIRECTORY_PATH: FirebaseStorage.EXTERNAL_DIRECTORY_PATH,
|
||||
EXTERNAL_STORAGE_DIRECTORY_PATH:
|
||||
FirebaseStorage.EXTERNAL_STORAGE_DIRECTORY_PATH,
|
||||
TEMP_DIRECTORY_PATH: FirebaseStorage.TEMP_DIRECTORY_PATH,
|
||||
LIBRARY_DIRECTORY_PATH: FirebaseStorage.LIBRARY_DIRECTORY_PATH,
|
||||
FILETYPE_REGULAR: FirebaseStorage.FILETYPE_REGULAR,
|
||||
FILETYPE_DIRECTORY: FirebaseStorage.FILETYPE_DIRECTORY,
|
||||
MAIN_BUNDLE_PATH: stripTrailingSlash(FirebaseStorage.MAIN_BUNDLE_PATH),
|
||||
CACHES_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.CACHES_DIRECTORY_PATH
|
||||
),
|
||||
DOCUMENT_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.DOCUMENT_DIRECTORY_PATH
|
||||
),
|
||||
EXTERNAL_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.EXTERNAL_DIRECTORY_PATH
|
||||
),
|
||||
EXTERNAL_STORAGE_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.EXTERNAL_STORAGE_DIRECTORY_PATH
|
||||
),
|
||||
TEMP_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.TEMP_DIRECTORY_PATH
|
||||
),
|
||||
LIBRARY_DIRECTORY_PATH: stripTrailingSlash(
|
||||
FirebaseStorage.LIBRARY_DIRECTORY_PATH
|
||||
),
|
||||
FILETYPE_REGULAR: stripTrailingSlash(FirebaseStorage.FILETYPE_REGULAR),
|
||||
FILETYPE_DIRECTORY: stripTrailingSlash(
|
||||
FirebaseStorage.FILETYPE_DIRECTORY
|
||||
),
|
||||
}
|
||||
: {},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue