More cleanup.

This commit is contained in:
Max Goedjen 2020-09-10 23:27:51 -07:00
parent 54d7fbe88d
commit 94689ae70d
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
2 changed files with 15 additions and 8 deletions

View File

@ -74,13 +74,7 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
.toolbar {
updateNotice
agentNotice
ToolbarItem {
Button(action: {
showingCreation = true
}, label: {
Image(systemName: "plus")
})
}
newItem
}
}
@ -114,6 +108,19 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
}
}
var newItem: ToolbarItem<Void, AnyView> {
guard storeList.modifiableStore?.isAvailable ?? false else {
return ToolbarItem { AnyView(Spacer()) }
}
return ToolbarItem {
AnyView(Button(action: {
showingCreation = true
}, label: {
Image(systemName: "plus")
}))
}
}
var agentNotice: ToolbarItem<Void, AnyView> {
guard agentStatusChecker.running else {
return ToolbarItem { AnyView(Spacer()) }

View File

@ -101,7 +101,7 @@ struct SetupStepCommandView: View {
.background(Color(white: 0, opacity: 0.10))
.cornerRadius(10)
.onDrag {
return NSItemProvider(item: NSData(data: text.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String)
NSItemProvider(item: NSData(data: text.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String)
}
}