mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Remove unnecessary alert because we don't clobber data anymore
This commit is contained in:
parent
5c08a9e723
commit
a3fe7630e8
@ -3,7 +3,6 @@ import SwiftUI
|
||||
struct PostListView: View {
|
||||
@EnvironmentObject var model: WriteFreelyModel
|
||||
@State var selectedCollection: PostCollection
|
||||
@State private var isPresentingRefreshWarning = false
|
||||
|
||||
#if os(iOS)
|
||||
@State private var isPresentingSettings = false
|
||||
@ -55,25 +54,10 @@ struct PostListView: View {
|
||||
.foregroundColor(.secondary)
|
||||
Spacer()
|
||||
Button(action: {
|
||||
isPresentingRefreshWarning = true
|
||||
reloadFromServer()
|
||||
}, 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()
|
||||
@ -103,23 +87,10 @@ struct PostListView: View {
|
||||
Image(systemName: "square.and.pencil")
|
||||
})
|
||||
Button(action: {
|
||||
isPresentingRefreshWarning = true
|
||||
reloadFromServer()
|
||||
}, label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
})
|
||||
.alert(isPresented: $isPresentingRefreshWarning, content: {
|
||||
Alert(
|
||||
title: Text("Are you sure you want to reload content from the server?"),
|
||||
message: Text("""
|
||||
Content on your Mac 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.
|
||||
"""),
|
||||
primaryButton: .cancel(),
|
||||
secondaryButton: .destructive(Text("Reload From Server"), action: reloadFromServer)
|
||||
)
|
||||
})
|
||||
.disabled(!model.account.isLoggedIn)
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user