1
0
mirror of https://github.com/metabolist/metatext synced 2024-12-27 10:12:36 +01:00

UI refinements

This commit is contained in:
Justin Mazzocchi 2020-09-10 19:05:13 -07:00
parent 921e84c08b
commit 757e8dba35
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
2 changed files with 10 additions and 1 deletions

View File

@ -10,4 +10,13 @@ extension View {
Alert(title: Text($0.error.localizedDescription))
}
}
@ViewBuilder
func animation(_ animation: Animation?, if condition: Bool) -> some View {
if condition {
self.animation(animation)
} else {
self
}
}
}

View File

@ -49,7 +49,7 @@ struct AddIdentityView: View {
.frame(maxWidth: .infinity, alignment: .center)
}
}
.animation(.default)
.animation(.default, if: !viewModel.loading)
.alertItem($viewModel.alertItem)
.onReceive(viewModel.addedIdentityID) { id in
withAnimation {