Refactor Rageshake URL and Target configuration. (#4337)

* Move the rageshakeURL configuration from the BugReportService to AppSettings.

* Refactor Target to return a handle when configuring.

This helps with reconfiguration and removes the @MainActor constraint.
This commit is contained in:
Doug
2025-07-22 10:19:26 +01:00
committed by GitHub
parent 97f517129f
commit 82c659f3da
17 changed files with 241 additions and 179 deletions
@@ -9,15 +9,18 @@ import IntentsUI
import SwiftUI
class ShareExtensionViewController: UIViewController {
private static var targetConfiguration: Target.Configuration?
private let appSettings: CommonSettingsProtocol = AppSettings()
private let hostingController = UIHostingController(rootView: ShareExtensionView())
override func viewDidLoad() {
super.viewDidLoad()
Target.shareExtension.configure(logLevel: appSettings.logLevel,
traceLogPacks: appSettings.traceLogPacks,
sentryURL: nil)
if Self.targetConfiguration == nil {
Self.targetConfiguration = Target.shareExtension.configure(logLevel: appSettings.logLevel,
traceLogPacks: appSettings.traceLogPacks,
sentryURL: nil)
}
addChild(hostingController)
view.addMatchedSubview(hostingController.view)