Skip to content

Commit

Permalink
Merge pull request #536 from martenrebane/MOPPAND-1352
Browse files Browse the repository at this point in the history
Fix container name showing when name change cancelled
  • Loading branch information
Counter178 authored Aug 22, 2024
2 parents e74ed99 + d764bcb commit deff172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ public static CryptoCreateScreen open(android.content.Intent intent) {
@SuppressWarnings("WeakerAccess")
public CryptoCreateScreen(Bundle args) {
super(args);
containerFromSigning = args.containsKey(KEY_CONTAINER_FILE)
isFromSignatureView = args.getBoolean(KEY_IS_FROM_SIGNATURE_VIEW);
containerFromSigning = isFromSignatureView && args.containsKey(KEY_CONTAINER_FILE)
? getFile(args, KEY_CONTAINER_FILE)
: null;
containerFile = !isFromSignatureView && args.containsKey(KEY_CONTAINER_FILE) ? getFile(args, KEY_CONTAINER_FILE) : null;
intent = getIntent(args);
isFromSignatureView = args.getBoolean(KEY_IS_FROM_SIGNATURE_VIEW);
}

private Observable<Intent.InitialIntent> initialIntent() {
Expand All @@ -146,7 +147,7 @@ private Observable<Intent.NameUpdateIntent> nameUpdateIntent() {
.map(ignored -> Intent.NameUpdateIntent.show(name)),
cancels(nameUpdateDialog).map(ignored -> {
AccessibilityUtils.sendAccessibilityEvent(view.getContext(), TYPE_ANNOUNCEMENT, R.string.container_name_change_cancelled);
return Intent.NameUpdateIntent.clear();
return Intent.NameUpdateIntent.clear(name);
}),
nameUpdateDialog.updates()
.map(newName -> Intent.NameUpdateIntent.update(name, newName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ static NameUpdateIntent update(String oldName, String newName) {
return create(oldName, newName);
}

static NameUpdateIntent clear() {
return create(null, null);
static NameUpdateIntent clear(String oldName) {
return create(null, oldName);
}

private static NameUpdateIntent create(String name, String newName) {
Expand Down

0 comments on commit deff172

Please sign in to comment.