Skip to content

Commit

Permalink
After some pending task image upload be sure to update data to send t…
Browse files Browse the repository at this point in the history
…o server fix #12
  • Loading branch information
e-marchand committed Jan 30, 2024
1 parent bf4722a commit fa13863
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ object ActionHelper {
return map
}

fun updateActionContent(actionContent: MutableMap<String, Any>?,
parameters: HashMap<String, Any>? = null,
metaData: HashMap<String, String>? = null) {

parameters?.let { actionContent?.put("parameters", parameters) }
metaData?.let { actionContent?.put("metadata", ActionMetaData(metaData)) }
}

fun updateActionContentId(actionContent: MutableMap<String, Any>?) {
actionContent?.put("id", UUID.randomUUID().toString())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ class MainActivity :
parameterName,
UPLOADED_METADATA_STRING
)
// MAYBE reset this to not upload pendingTask.actionInfo.imagesToUpload?.set(parameterName, null)
},
onImageFailed = { parameterName, throwable ->
pendingTask.actionInfo.metaDataToSubmit?.set(
Expand All @@ -958,6 +959,9 @@ class MainActivity :
)
},
onAllUploadFinished = {
ActionHelper.updateActionContent(pendingTask.actionContent,
parameters = pendingTask.actionInfo.paramsToSubmit,
metaData = pendingTask.actionInfo.metaDataToSubmit)
sendAction(pendingTask, pendingTask.actionInfo.tableName) {
// Nothing to do
}
Expand Down

0 comments on commit fa13863

Please sign in to comment.