Skip to content

Commit f8e69a2

Browse files
committed
load ai api key if any
1 parent 4368cb3 commit f8e69a2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import KeychainAccess
2727
keychain.merchantAIProviderKey = nil
2828
}
2929

30+
func loadSettings() {
31+
apiKey = keychain.merchantAIProviderKey ?? ""
32+
}
33+
3034
private func saveSettings() {
3135
keychain.merchantAIProviderKey = apiKey
3236
}
@@ -132,6 +136,9 @@ struct AISettingsView: View {
132136
.foregroundColor(.secondary)
133137
.frame(maxWidth: .infinity, alignment: .center)
134138
}
139+
.onAppear {
140+
viewModel.loadSettings()
141+
}
135142
.padding()
136143
.navigationTitle(Localization.navigationTitle)
137144
}

0 commit comments

Comments
 (0)