mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
[ios] Adding link to delete OSM profile page
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -111,6 +111,10 @@ public:
|
||||
{
|
||||
return m_baseUrl + "/user/" + user + "/notes";
|
||||
}
|
||||
std::string GetDeleteURL() const
|
||||
{
|
||||
return m_baseUrl + "/account/deletion";
|
||||
}
|
||||
std::string BuildOAuth2Url() const;
|
||||
//@}
|
||||
|
||||
|
||||
@@ -95,6 +95,13 @@ import OSMEditor
|
||||
}
|
||||
|
||||
|
||||
/// The URL for deleting an OpenStreetMap profile
|
||||
static var deleteUrl: URL {
|
||||
return URL(string: String(describing: osm.OsmOAuth.ServerAuth().GetDeleteURL()))!
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: Methods
|
||||
|
||||
/// Save the authorization token based on a code during the Oauth process
|
||||
|
||||
@@ -58,6 +58,7 @@ struct ProfileView: View {
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .destructiveAction) {
|
||||
if !isPresentedAsAlert, Profile.isExisting, !Profile.needsReauthorization {
|
||||
Menu {
|
||||
Button {
|
||||
Profile.logout()
|
||||
lastUpdated = Date.now
|
||||
@@ -68,6 +69,22 @@ struct ProfileView: View {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user