mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add toolbar button logic, menu item, keyboard shortcut for server reload
This commit is contained in:
parent
735867a940
commit
acde0c8978
@ -54,7 +54,12 @@ struct ContentView: View {
|
||||
PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigation) {
|
||||
Button(action: {}, label: { Image(systemName: "arrow.clockwise") })
|
||||
Button(action: {
|
||||
DispatchQueue.main.async {
|
||||
model.fetchUserCollections()
|
||||
model.fetchUserPosts()
|
||||
}
|
||||
}, label: { Image(systemName: "arrow.clockwise") })
|
||||
.padding(.leading, sidebarIsHidden ? 8 : 0)
|
||||
.animation(.linear)
|
||||
}
|
||||
|
@ -30,6 +30,15 @@ struct WriteFreely_MultiPlatformApp: App {
|
||||
}
|
||||
.keyboardShortcut("n", modifiers: [.command])
|
||||
})
|
||||
CommandGroup(after: .newItem) {
|
||||
Button("Reload From Server") {
|
||||
DispatchQueue.main.async {
|
||||
model.fetchUserCollections()
|
||||
model.fetchUserPosts()
|
||||
}
|
||||
}
|
||||
.keyboardShortcut("r", modifiers: [.command])
|
||||
}
|
||||
#if os(macOS)
|
||||
CommandGroup(after: .sidebar) {
|
||||
Button("Toggle Sidebar") {
|
||||
|
Loading…
Reference in New Issue
Block a user