diff --git a/Features/Sources/Settings/Settings/SettingsView.swift b/Features/Sources/Settings/Settings/SettingsView.swift index 8ba0687..61cca83 100644 --- a/Features/Sources/Settings/Settings/SettingsView.swift +++ b/Features/Sources/Settings/Settings/SettingsView.swift @@ -31,7 +31,7 @@ public struct SettingsView: View { Spacer() - Text(APIClient.apiKey?.rawValue ?? "None") + Text(APIClient.apiKey?.rawValue.masked ?? "None") .foregroundStyle(Color.secondary) } } diff --git a/Features/Sources/Settings/String.swift b/Features/Sources/Settings/String.swift new file mode 100644 index 0000000..e33f5d7 --- /dev/null +++ b/Features/Sources/Settings/String.swift @@ -0,0 +1,8 @@ +extension String { + var masked: String? { + guard let first = self.first else { + return nil + } + return "\(first)***" + } +}