File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Anytype/Sources/PresentationLayer/ObjectTypeSearch/NewTypeCreation Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,10 @@ struct ObjectTypeInfoView: View {
118118 switch model. mode {
119119 case . create:
120120 StandardButton ( Loc . create, style: . primaryLarge) { model. onSaveTap ( ) }
121+ . disabled ( !model. isCreateButtonEnabled)
121122 case . edit:
122123 StandardButton ( Loc . save, style: . primaryLarge) { model. onSaveTap ( ) }
124+ . disabled ( !model. isCreateButtonEnabled)
123125 case . preview:
124126 EmptyView ( )
125127 }
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ final class ObjectTypeInfoViewModel: ObservableObject {
1515 return ObjectIcon . customIcon ( CustomIconData ( icon: icon, customColor: color ?? . default) )
1616 }
1717 var isRemoveIconButtonAvailable : Bool { icon. isNotNil }
18-
18+ var isCreateButtonEnabled : Bool { !name. trimmingCharacters ( in: . whitespacesAndNewlines) . isEmpty }
19+
1920 var dismiss : DismissAction ?
2021
2122 let mode : ObjectTypeInfoViewMode
You can’t perform that action at this time.
0 commit comments