Skip to content

Commit

Permalink
Don't publish description/focus point updates via the standard api wh…
Browse files Browse the repository at this point in the history
…en editing a published post
  • Loading branch information
Tak committed Feb 1, 2023
1 parent d691cd5 commit 79aae4a
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,20 @@ class ComposeViewModel @Inject constructor(
}
}

val updatedItem = newMediaList.find { it.localId == localId }
if (updatedItem?.id != null) {
val focus = updatedItem.focus
val focusString = if (focus != null) "${focus.x},${focus.y}" else null
return api.updateMedia(updatedItem.id, updatedItem.description, focusString)
.fold({
true
}, { throwable ->
Log.w(TAG, "failed to update media", throwable)
false
})
if (!editing) {
// Updates to media for already-published statuses need to go through the status edit api
val updatedItem = newMediaList.find { it.localId == localId }
if (updatedItem?.id != null) {
val focus = updatedItem.focus
val focusString = if (focus != null) "${focus.x},${focus.y}" else null
return api.updateMedia(updatedItem.id, updatedItem.description, focusString)
.fold({
true
}, { throwable ->
Log.w(TAG, "failed to update media", throwable)
false
})
}
}
return true
}
Expand Down

0 comments on commit 79aae4a

Please sign in to comment.