change draft attachment directory (#2070)
This commit is contained in:
parent
657a8a0b8c
commit
be77d91e91
1 changed files with 8 additions and 2 deletions
|
@ -59,13 +59,19 @@ class DraftHelper @Inject constructor(
|
|||
): Completable {
|
||||
return Single.fromCallable {
|
||||
|
||||
val draftDirectory = context.getExternalFilesDir("Tusky")
|
||||
val externalFilesDir = context.getExternalFilesDir("Tusky")
|
||||
|
||||
if (draftDirectory == null || !(draftDirectory.exists())) {
|
||||
if (externalFilesDir == null || !(externalFilesDir.exists())) {
|
||||
Log.e("DraftHelper", "Error obtaining directory to save media.")
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
val draftDirectory = File(externalFilesDir, "Drafts")
|
||||
|
||||
if (!draftDirectory.exists()) {
|
||||
draftDirectory.mkdir()
|
||||
}
|
||||
|
||||
val uris = mediaUris.map { uriString ->
|
||||
uriString.toUri()
|
||||
}.map { uri ->
|
||||
|
|
Loading…
Reference in a new issue