This commit is contained in:
Thomas 2023-01-06 15:57:05 +01:00
parent 17d6152af3
commit 7e1d9b8910

View file

@ -270,7 +270,11 @@ public class ComposeWorker extends Worker {
b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true); b.putBoolean(Helper.RECEIVE_COMPOSE_ERROR_MESSAGE, true);
Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE); Intent intentBD = new Intent(Helper.INTENT_COMPOSE_ERROR_MESSAGE);
b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft); b.putSerializable(Helper.ARG_STATUS_DRAFT, dataPost.statusDraft);
b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, statusResponse.errorBody().string()); String err = statusResponse.errorBody().string();
if (err.contains("{\"error\":\"")) {
err = err.replaceAll("\\{\"error\":\"(.*)\"}", "$1");
}
b.putSerializable(Helper.RECEIVE_ERROR_MESSAGE, err);
intentBD.putExtras(b); intentBD.putExtras(b);
LocalBroadcastManager.getInstance(context).sendBroadcast(intentBD); LocalBroadcastManager.getInstance(context).sendBroadcast(intentBD);
return; return;