Skip to content

Commit 4368cb3

Browse files
committed
render clear button when editing api key and not empty
1 parent cb11cb0 commit 4368cb3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WooCommerce/Classes/ViewRelated/AI Settings/AISettingsView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ struct AISettingsView: View {
6969
.textFieldStyle(RoundedBorderTextFieldStyle())
7070
.foregroundColor(.primary)
7171
.privacySensitive()
72+
.disabled(!viewModel.isEditingApiKey)
7273

73-
if viewModel.isEditingApiKey, !viewModel.apiKey.isEmpty {
74+
if viewModel.isEditingApiKey && !viewModel.apiKey.isEmpty {
7475
Button(action: viewModel.clearAPIKey) {
7576
Image(systemName: "xmark.circle.fill")
7677
.foregroundColor(.gray)

0 commit comments

Comments
 (0)