Upon error on saving, revert value

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2021-04-08 14:15:27 +02:00
parent 208e96e1c0
commit ea50cf60e5
No known key found for this signature in database
GPG Key ID: 0E00D4D47D0C5AF7
2 changed files with 8 additions and 0 deletions

View File

@ -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);
}

View File

@ -388,4 +388,5 @@
<string name="path_password_strike_through" translatable="false" tools:override="true">M3.27,4.27L19.74,20.74</string>
<string name="tooManyUnreadMessages" translatable="false">999+</string>
<string name="nc_action_open_main_menu">Open main menu</string>
<string name="failed_to_save">Failed to save %1$s as %2$s</string>
</resources>