[ios] Adding link to delete OSM profile page

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-13 01:19:18 +02:00
parent 8b3cdbb937
commit 54681719fb
3 changed files with 31 additions and 3 deletions

View File

@@ -58,15 +58,32 @@ struct ProfileView: View {
.toolbar {
ToolbarItem(placement: .destructiveAction) {
if !isPresentedAsAlert, Profile.isExisting, !Profile.needsReauthorization {
Button {
Profile.logout()
lastUpdated = Date.now
Menu {
Button {
Profile.logout()
lastUpdated = Date.now
} label: {
if #available(iOS 16, *) {
Label("osm_profile_logout", systemImage: "rectangle.portrait.and.arrow.forward")
} else {
Label("osm_profile_logout", systemImage: "power")
}
}
Button(role: .destructive) {
openUrl(Profile.deleteUrl)
} label: {
Label("osm_profile_delete", systemImage: "trash")
}
} label: {
if #available(iOS 16, *) {
Label("osm_profile_logout", systemImage: "rectangle.portrait.and.arrow.forward")
} else {
Label("osm_profile_logout", systemImage: "power")
}
} primaryAction: {
Profile.logout()
lastUpdated = Date.now
}
}
}