From c3d1c6d363a88bf058fdbdc021ebfd2cd80b8413 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Fri, 10 Mar 2023 18:22:13 +0100 Subject: [PATCH] Add a Mastometrics link in account menu --- .../Sources/Account/AccountDetailView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Packages/Account/Sources/Account/AccountDetailView.swift b/Packages/Account/Sources/Account/AccountDetailView.swift index 7992256f..00a33d3f 100644 --- a/Packages/Account/Sources/Account/AccountDetailView.swift +++ b/Packages/Account/Sources/Account/AccountDetailView.swift @@ -8,6 +8,7 @@ import Status import SwiftUI public struct AccountDetailView: View { + @Environment(\.openURL) private var openURL @Environment(\.redactionReasons) private var reasons @EnvironmentObject private var watcher: StreamWatcher @@ -329,6 +330,20 @@ public struct AccountDetailView: View { Label("settings.push.navigation-title", systemImage: "bell") } + if let account = viewModel.account { + Divider() + + Button { + if let url = URL(string: "https://mastometrics.com/auth/login?username=\(account.acct)@\(client.server)&instance=\(client.server)&auto=true") { + openURL(url) + } + } label: { + Label("Mastometrics", systemImage: "chart.xyaxis.line") + } + + Divider() + } + Button { routerPath.presentedSheet = .settings } label: {