Skip to content

Commit 18ff0cd

Browse files
committed
Fix confirm dialog
1 parent 8e412a2 commit 18ff0cd

4 files changed

Lines changed: 30 additions & 15 deletions

File tree

Planet/Views/Following/FollowingArticleItemView.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,9 @@ struct FollowingArticleItemView: View {
141141
}
142142
}
143143
.confirmationDialog(
144-
Text(
145-
"Are you sure you want to delete this article? This action will remove it from your feed. However, if the article is still available on the source, it will reappear in your feed the next time you refresh it."
146-
),
147-
isPresented: $isShowingDeleteConfirmation
144+
Text("Delete Article"),
145+
isPresented: $isShowingDeleteConfirmation,
146+
titleVisibility: .visible
148147
) {
149148
Button(role: .destructive) {
150149
Task { @MainActor in
@@ -162,6 +161,10 @@ struct FollowingArticleItemView: View {
162161
} label: {
163162
Text("Delete")
164163
}
164+
} message: {
165+
Text(
166+
"Are you sure you want to delete this article? This action will remove it from your feed. However, if the article is still available on the source, it will reappear in your feed the next time you refresh it."
167+
)
165168
}
166169
}
167170
}

Planet/Views/My/MyArticleGridView.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ struct MyArticleGridView: View {
7272
)
7373
)
7474
.confirmationDialog(
75-
"Are you sure you want to delete this post?\n\n\(article.title)\n\nThis action cannot be undone.",
76-
isPresented: $isDeleting
75+
Text("Delete Post"),
76+
isPresented: $isDeleting,
77+
titleVisibility: .visible
7778
) {
7879
Button("Delete", role: .destructive) {
7980
ASMediaManager.shared.deactivateView(byID: article.id)
@@ -90,6 +91,8 @@ struct MyArticleGridView: View {
9091
}
9192
}
9293
Button("Cancel", role: .cancel) {}
94+
} message: {
95+
Text("Are you sure you want to delete this post?\n\n\(article.title)\n\nThis action cannot be undone.")
9396
}
9497
.contextMenu {
9598
Button {

Planet/Views/Sidebar/MyPlanetSidebarItem.swift

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,9 @@ struct MyPlanetSidebarItem: View {
248248
}
249249
}
250250
.confirmationDialog(
251-
Text(
252-
"Are you sure you want to archive this planet? Archived planets will not be auto published. You can later unarchive it from settings."
253-
),
254-
isPresented: $isShowingArchiveConfirmation
251+
Text("Archive Planet"),
252+
isPresented: $isShowingArchiveConfirmation,
253+
titleVisibility: .visible
255254
) {
256255
Button {
257256
planet.archive()
@@ -265,10 +264,15 @@ struct MyPlanetSidebarItem: View {
265264
} label: {
266265
Text("Archive")
267266
}
267+
} message: {
268+
Text(
269+
"Are you sure you want to archive this planet? Archived planets will not be auto published. You can later unarchive it from settings."
270+
)
268271
}
269272
.confirmationDialog(
270-
Text("Are you sure you want to delete \(planet.name)? This action cannot be undone."),
271-
isPresented: $isShowingDeleteConfirmation
273+
Text("Delete Planet"),
274+
isPresented: $isShowingDeleteConfirmation,
275+
titleVisibility: .visible
272276
) {
273277
Button(role: .destructive) {
274278
try? planet.delete()
@@ -281,10 +285,13 @@ struct MyPlanetSidebarItem: View {
281285
} label: {
282286
Text("Delete")
283287
}
288+
} message: {
289+
Text("Are you sure you want to delete \(planet.name)? This action cannot be undone.")
284290
}
285291
.confirmationDialog(
286-
Text("Are you sure you want to delete this article?"),
287-
isPresented: $planetStore.isShowingDeleteMyArticleConfirmation
292+
Text("Delete Article"),
293+
isPresented: $planetStore.isShowingDeleteMyArticleConfirmation,
294+
titleVisibility: .visible
288295
) {
289296
Button(role: .destructive) {
290297
if let article = planetStore.deletingMyArticle, let planet = article.planet {
@@ -322,6 +329,8 @@ struct MyPlanetSidebarItem: View {
322329
} label: {
323330
Text("Delete")
324331
}
332+
} message: {
333+
Text("Are you sure you want to delete this article?")
325334
}
326335
}
327336

Planet/versioning.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CURRENT_PROJECT_VERSION = 2755
1+
CURRENT_PROJECT_VERSION = 2756

0 commit comments

Comments
 (0)