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 {
|
): Completable {
|
||||||
return Single.fromCallable {
|
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.")
|
Log.e("DraftHelper", "Error obtaining directory to save media.")
|
||||||
throw Exception()
|
throw Exception()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val draftDirectory = File(externalFilesDir, "Drafts")
|
||||||
|
|
||||||
|
if (!draftDirectory.exists()) {
|
||||||
|
draftDirectory.mkdir()
|
||||||
|
}
|
||||||
|
|
||||||
val uris = mediaUris.map { uriString ->
|
val uris = mediaUris.map { uriString ->
|
||||||
uriString.toUri()
|
uriString.toUri()
|
||||||
}.map { uri ->
|
}.map { uri ->
|
||||||
|
|
Loading…
Reference in a new issue