mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Implement reload from server on iOS
This commit is contained in:
parent
978192201d
commit
ee0f72b5ef
@ -49,9 +49,32 @@ struct PostListView: View {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
}
|
||||
)
|
||||
.padding(.leading)
|
||||
Spacer()
|
||||
Text(pluralizedPostCount(for: showPosts(for: selectedCollection)))
|
||||
.foregroundColor(.secondary)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
isPresentingRefreshWarning = true
|
||||
}, label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
})
|
||||
.actionSheet(isPresented: $isPresentingRefreshWarning, content: {
|
||||
ActionSheet(
|
||||
title: Text("Are you sure you want to reload content from the server?"),
|
||||
message: Text("""
|
||||
Content on your device will be replaced by content from the server and any unpublished changes \
|
||||
will be lost, except for local drafts.
|
||||
|
||||
You can't undo this action.
|
||||
"""),
|
||||
buttons: [
|
||||
.cancel(),
|
||||
.destructive(Text("Reload From Server"), action: reloadFromServer)
|
||||
]
|
||||
)
|
||||
})
|
||||
.disabled(!model.account.isLoggedIn)
|
||||
}
|
||||
.padding()
|
||||
.frame(width: geometry.size.width)
|
||||
|
Loading…
Reference in New Issue
Block a user