Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container name showing when name change cancelled #536

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading