mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
set username as available when validation api returns void
This commit is contained in:
parent
d69a43d00f
commit
e6e954c7ad
2 changed files with 7 additions and 3 deletions
|
|
@ -56,6 +56,7 @@ import Views
|
|||
Task {
|
||||
do {
|
||||
try await dataService.validateUsernamePublisher(username: username)
|
||||
potentialUsernameStatus = .available
|
||||
} catch {
|
||||
let usernameError = (error as? UsernameAvailabilityError) ?? .unknown
|
||||
switch usernameError {
|
||||
|
|
@ -152,6 +153,9 @@ struct CreateProfileView: View {
|
|||
.font(.appFootnote)
|
||||
.foregroundColor(.appGrayText)
|
||||
TextField("", text: $viewModel.potentialUsername)
|
||||
#if os(iOS)
|
||||
.textInputAutocapitalization(.never)
|
||||
#endif
|
||||
}
|
||||
|
||||
if viewModel.potentialUsernameStatus == .available {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ struct WelcomeView: View {
|
|||
}
|
||||
|
||||
var authProviderButtonStack: some View {
|
||||
let useHorizontalLayout = containerSize.width > 400
|
||||
let useHorizontalLayout = containerSize.width > 500
|
||||
|
||||
let buttonGroup = Group {
|
||||
AppleSignInButton {
|
||||
|
|
@ -166,7 +166,7 @@ struct WelcomeView: View {
|
|||
}
|
||||
|
||||
public var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
ZStack(alignment: viewModel.registrationState == nil ? .leading : .center) {
|
||||
Color.appBackground
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
.modifier(SizeModifier())
|
||||
|
|
@ -189,7 +189,7 @@ struct WelcomeView: View {
|
|||
logoView
|
||||
.padding(.bottom, 20)
|
||||
headlineView
|
||||
if containerSize.width > 400 {
|
||||
if containerSize.width > 500 {
|
||||
authProviderButtonStack
|
||||
} else {
|
||||
HStack {
|
||||
|
|
|
|||
Loading…
Reference in a new issue