Browse Source

change draft attachment directory (#2070)

pull/2076/head
Konrad Pozniak 5 years ago committed by GitHub
parent
commit
be77d91e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/src/main/java/com/keylesspalace/tusky/components/drafts/DraftHelper.kt

10
app/src/main/java/com/keylesspalace/tusky/components/drafts/DraftHelper.kt

@ -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…
Cancel
Save