From ea50cf60e58823ba2432137e92c176bce8812bdd Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 8 Apr 2021 14:15:27 +0200 Subject: [PATCH] Upon error on saving, revert value Signed-off-by: tobiasKaminsky --- .../com/nextcloud/talk/controllers/ProfileController.java | 7 +++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java b/app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java index 8a0ab7e1e..df4769a0e 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java @@ -462,6 +462,13 @@ public class ProfileController extends BaseController { @Override public void onError(@NotNull Throwable e) { item.text = userInfo.getValueByField(item.field); + Toast.makeText(getApplicationContext(), + String.format(getResources().getString(R.string.failed_to_save), + item.text, + item.field), + Toast.LENGTH_LONG).show(); + adapter.updateFilteredList(); + adapter.notifyDataSetChanged(); Log.e(TAG, "Failed to saved: " + item.text + " as " + item.field, e); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 298edb026..f317816bc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -388,4 +388,5 @@ M3.27,4.27L19.74,20.74 999+ Open main menu + Failed to save %1$s as %2$s