77
88import Reaper
99import Sentry
10- import SwiftUI
1110import SwiftData
11+ import SwiftUI
1212
1313@main
1414struct Hacker_NewsApp : App {
@@ -17,12 +17,13 @@ struct Hacker_NewsApp: App {
1717 init ( ) {
1818 UINavigationBar . appearance ( ) . backgroundColor = . clear
1919 UICollectionView . appearance ( ) . backgroundColor = . clear
20-
20+
2121 EMGReaper . sharedInstance ( ) . start ( withAPIKey: " f77fb081-cfc2-4d15-acb5-18bad59c9376 " )
22-
22+
2323 SentrySDK . start { options in
24- options. dsn = " https://118cff4b239bd3e0ede8fd74aad9bf8f@o497846.ingest.sentry.io/4506027753668608 "
25- options. enableTracing = true
24+ options. dsn =
25+ " https://118cff4b239bd3e0ede8fd74aad9bf8f@o497846.ingest.sentry.io/4506027753668608 "
26+ options. enableTracing = true
2627 }
2728 }
2829
@@ -38,17 +39,18 @@ struct Hacker_NewsApp: App {
3839 . navigationDestination ( for: AppViewModel . AppNavigation. self) { appNavigation in
3940 switch appNavigation {
4041 case . webLink( let url, let title) :
41- WebView ( url: url)
42+ WebViewContainer ( url: url, title : title )
4243 . ignoresSafeArea ( )
43- . navigationTitle ( title)
44- . navigationBarTitleDisplayMode ( . inline)
4544 case . storyComments( let story) :
46- let commentModel = CommentsViewModel ( story: story, auth: appModel. authState) { destination in
45+ let commentModel = CommentsViewModel ( story: story, auth: appModel. authState) {
46+ destination in
4747 switch destination {
4848 case . back:
4949 appModel. backPressed ( )
5050 case . login:
5151 appModel. gotoLogin ( )
52+ case let . website( url) :
53+ appModel. openLink ( url: url)
5254 }
5355 }
5456 CommentsScreen ( model: commentModel)
0 commit comments