From 0dd8f240c781c2a42a490a4e65c620f23333715a Mon Sep 17 00:00:00 2001 From: mplorentz Date: Fri, 27 Dec 2024 09:24:51 -0500 Subject: [PATCH 1/3] Add Inject framework for hot reloading --- Nos.xcodeproj/project.pbxproj | 16 ++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 11 ++++++++++- Nos/NosApp.swift | 7 +++++++ Nos/Views/AppView.swift | 3 +++ Nos/Views/Home/HomeFeedView.swift | 3 +++ Nos/Views/Home/HomeTab.swift | 3 +++ Nos/Views/SideMenu/SideMenuContent.swift | 3 +++ 7 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Nos.xcodeproj/project.pbxproj b/Nos.xcodeproj/project.pbxproj index b1cf16735..af3b7b5b3 100644 --- a/Nos.xcodeproj/project.pbxproj +++ b/Nos.xcodeproj/project.pbxproj @@ -437,6 +437,7 @@ C987F85429BA951E00B44E7A /* ClarityCity-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = C987F83129BA951E00B44E7A /* ClarityCity-Thin.otf */; }; C987F85529BA951E00B44E7A /* ClarityCity-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = C987F83129BA951E00B44E7A /* ClarityCity-Thin.otf */; }; C987F85B29BA9ED800B44E7A /* Font+Clarity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C987F85729BA981800B44E7A /* Font+Clarity.swift */; }; + C98905A22CD3B8CF00C17EE0 /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = C98905A12CD3B8CF00C17EE0 /* Inject */; }; C98A32272A05795E00E3FA13 /* Task+Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98A32262A05795E00E3FA13 /* Task+Timeout.swift */; }; C98A32282A05795E00E3FA13 /* Task+Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98A32262A05795E00E3FA13 /* Task+Timeout.swift */; }; C98B8B4029FBF83B009789C8 /* NotificationCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98B8B3F29FBF83B009789C8 /* NotificationCard.swift */; }; @@ -2101,6 +2102,7 @@ C9FD35122BCED5A6008F8D95 /* NostrSDK */, 03C49ABF2C938A9C00502321 /* SwiftSoup */, 039389222CA4985C00698978 /* SDWebImageWebPCoder */, + C98905A12CD3B8CF00C17EE0 /* Inject */, ); productName = Nos; productReference = C9DEBFCE298941000078B43A /* Nos.app */; @@ -2197,6 +2199,7 @@ C9FD35112BCED5A6008F8D95 /* XCRemoteSwiftPackageReference "nostr-sdk-ios" */, 03C49ABE2C938A9C00502321 /* XCRemoteSwiftPackageReference "SwiftSoup" */, 039389212CA4985C00698978 /* XCRemoteSwiftPackageReference "SDWebImageWebPCoder" */, + C98905A02CD3B8CF00C17EE0 /* XCRemoteSwiftPackageReference "Inject" */, ); productRefGroup = C9DEBFCF298941000078B43A /* Products */; projectDirPath = ""; @@ -3661,6 +3664,14 @@ minimumVersion = 1.0.0; }; }; + C98905A02CD3B8CF00C17EE0 /* XCRemoteSwiftPackageReference "Inject" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/krzysztofzablocki/Inject.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.5.2; + }; + }; C99DBF7C2A9E81CF00F7068F /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SDWebImage/SDWebImageSwiftUI"; @@ -3812,6 +3823,11 @@ package = C96CB98A2A6040C500498C4E /* XCRemoteSwiftPackageReference "swift-collections" */; productName = DequeModule; }; + C98905A12CD3B8CF00C17EE0 /* Inject */ = { + isa = XCSwiftPackageProductDependency; + package = C98905A02CD3B8CF00C17EE0 /* XCRemoteSwiftPackageReference "Inject" */; + productName = Inject; + }; C99DBF7D2A9E81CF00F7068F /* SDWebImageSwiftUI */ = { isa = XCSwiftPackageProductDependency; package = C99DBF7C2A9E81CF00F7068F /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */; diff --git a/Nos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Nos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7590212f9..6ebc64605 100644 --- a/Nos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Nos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "f8bae06dbeb84f5992ca8659ee3a2a75550fe8b31994d37a658183a21f1c8131", + "originHash" : "62d037ae150ed2e6e150f06b42119c5158134318243e742971b3ccfa3a3a5323", "pins" : [ { "identity" : "bech32", @@ -37,6 +37,15 @@ "version" : "1.8.2" } }, + { + "identity" : "inject", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzysztofzablocki/Inject.git", + "state" : { + "revision" : "728c56639ecb3df441d51d5bc6747329afabcfc9", + "version" : "1.5.2" + } + }, { "identity" : "libwebp-xcode", "kind" : "remoteSourceControl", diff --git a/Nos/NosApp.swift b/Nos/NosApp.swift index 48ef27900..1a06325a7 100644 --- a/Nos/NosApp.swift +++ b/Nos/NosApp.swift @@ -2,6 +2,7 @@ import SwiftUI import Logger import Dependencies import TipKit +import Inject @main struct NosApp: App { @@ -15,6 +16,7 @@ struct NosApp: App { private let appController = AppController() @Environment(\.scenePhase) private var scenePhase @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate + @ObserveInjection var inject init() { _ = crashReporting // force crash reporting init as early as possible @@ -24,6 +26,11 @@ struct NosApp: App { UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .systemBlue persistenceController.scheduleBackgroundCleanupTask() try? Tips.configure() + + #if DEBUG + Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load() + InjectConfiguration.animation = .interactiveSpring() + #endif } var body: some Scene { diff --git a/Nos/Views/AppView.swift b/Nos/Views/AppView.swift index 5bd1d21e0..dec6b4de2 100644 --- a/Nos/Views/AppView.swift +++ b/Nos/Views/AppView.swift @@ -1,5 +1,6 @@ import SwiftUI import Dependencies +import Inject struct AppView: View { @@ -14,6 +15,7 @@ struct AppView: View { @Dependency(\.userDefaults) private var userDefaults @Environment(CurrentUser.self) var currentUser @Environment(RelayService.self) private var relayService + @ObserveInjection var inject @State private var lastSelectedTab = AppDestination.home @State private var showNIP05Wizard = false @@ -47,6 +49,7 @@ struct AppView: View { } .task { await presentNIP05SheetIfNeeded() } .tint(.primaryTxt) + .enableInjection() } private var tabView: some View { diff --git a/Nos/Views/Home/HomeFeedView.swift b/Nos/Views/Home/HomeFeedView.swift index d36e73fc1..b0bf4a6d4 100644 --- a/Nos/Views/Home/HomeFeedView.swift +++ b/Nos/Views/Home/HomeFeedView.swift @@ -3,12 +3,14 @@ import CoreData import Combine import Dependencies import TipKit +import Inject struct HomeFeedView: View { @Environment(\.managedObjectContext) private var viewContext @EnvironmentObject private var router: Router @ObservationIgnored @Dependency(\.analytics) private var analytics + @ObserveInjection var inject @State private var refreshController = RefreshController(lastRefreshDate: Date.now + Self.staticLoadTime) @State private var isVisible = false @@ -164,6 +166,7 @@ struct HomeFeedView: View { GoToFeedTip.viewedFeed.sendDonation() } } + .enableInjection() } } diff --git a/Nos/Views/Home/HomeTab.swift b/Nos/Views/Home/HomeTab.swift index 7a0892268..8297f850a 100644 --- a/Nos/Views/Home/HomeTab.swift +++ b/Nos/Views/Home/HomeTab.swift @@ -1,16 +1,19 @@ import SwiftUI import Dependencies +import Inject struct HomeTab: View { @ObservedObject var user: Author @EnvironmentObject private var router: Router + @ObserveInjection var inject var body: some View { NosNavigationStack(path: $router.homeFeedPath) { HomeFeedView(user: user) } + .enableInjection() } } diff --git a/Nos/Views/SideMenu/SideMenuContent.swift b/Nos/Views/SideMenu/SideMenuContent.swift index 6d3bb5f6d..857fffab8 100644 --- a/Nos/Views/SideMenu/SideMenuContent.swift +++ b/Nos/Views/SideMenu/SideMenuContent.swift @@ -1,12 +1,14 @@ import SwiftUI import MessageUI import Dependencies +import Inject struct SideMenuContent: View { @EnvironmentObject private var router: Router @Environment(CurrentUser.self) private var currentUser @Dependency(\.analytics) private var analytics + @ObserveInjection var inject @State private var isShowingReportABugMailView = false @State private var shareNosPressed = false @@ -118,6 +120,7 @@ struct SideMenuContent: View { ProfileEditView(author: destination.profile) } } + .enableInjection() } } From 9aeed9c82e31e8800aecd5802d0af0b0abe64801 Mon Sep 17 00:00:00 2001 From: mplorentz Date: Fri, 27 Dec 2024 09:54:30 -0500 Subject: [PATCH 2/3] Add docs, revert changes to AppView --- CHANGELOG.md | 1 + CONTRIBUTING.md | 4 ++ Nos.xcodeproj/project.pbxproj | 12 +++- Nos/Views/AppView.swift | 129 +++++++++++++++++++++++++++++++--- 4 files changed, 136 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a718a8a9..a0bfefc92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Download and parse an author’s lists when viewing their profile. [#49](https://github.com/verse-pbc/issues/issues/49) - Updated fastlane scripts to fix the TestFlight deployment pipeline. [#97](https://github.com/verse-pbc/issues/issues/97) - Removed inactive accounts from Discover tab. [#94](https://github.com/verse-pbc/issues/issues/94) +- Added the Inject framework for hot reloading. [#1710](https://github.com/planetary-social/nos/pull/1710) ## [1.0.3] - 2024-12-04Z diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82968477f..e14ab2151 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,6 +53,10 @@ For now `main` is the main branch and code improvements are made in topic branch A maintainer will review your code and merge it when it has the required number of approvals. +## Hot Reloading + +We make use of the [Inject](https://github.com/krzysztofzablocki/Inject) framework for hot reloading debug builds. To set up hot reloading, follow the [documentation](https://github.com/krzysztofzablocki/Inject?tab=readme-ov-file#individual-developer-setup-once-per-machine). + ## Dependency Management We prefer to install dependencies using the Swift Package Manager. diff --git a/Nos.xcodeproj/project.pbxproj b/Nos.xcodeproj/project.pbxproj index af3b7b5b3..599e36e1e 100644 --- a/Nos.xcodeproj/project.pbxproj +++ b/Nos.xcodeproj/project.pbxproj @@ -437,7 +437,7 @@ C987F85429BA951E00B44E7A /* ClarityCity-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = C987F83129BA951E00B44E7A /* ClarityCity-Thin.otf */; }; C987F85529BA951E00B44E7A /* ClarityCity-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = C987F83129BA951E00B44E7A /* ClarityCity-Thin.otf */; }; C987F85B29BA9ED800B44E7A /* Font+Clarity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C987F85729BA981800B44E7A /* Font+Clarity.swift */; }; - C98905A22CD3B8CF00C17EE0 /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = C98905A12CD3B8CF00C17EE0 /* Inject */; }; + C9887D812D1EF3C400CF9101 /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = C98905A12CD3B8CF00C17EE0 /* Inject */; }; C98A32272A05795E00E3FA13 /* Task+Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98A32262A05795E00E3FA13 /* Task+Timeout.swift */; }; C98A32282A05795E00E3FA13 /* Task+Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98A32262A05795E00E3FA13 /* Task+Timeout.swift */; }; C98B8B4029FBF83B009789C8 /* NotificationCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98B8B3F29FBF83B009789C8 /* NotificationCard.swift */; }; @@ -1053,6 +1053,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C9887D812D1EF3C400CF9101 /* Inject in Frameworks */, C9DEC068298965270078B43A /* Starscream in Frameworks */, C9FD35132BCED5A6008F8D95 /* NostrSDK in Frameworks */, C9B71DC02A8E9BAD0031ED9F /* SentrySwiftUI in Frameworks */, @@ -2922,6 +2923,7 @@ MACOSX_DEPLOYMENT_TARGET = 13.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; @@ -3092,6 +3094,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -3142,6 +3145,11 @@ LOCALIZED_STRING_SWIFTUI_SUPPORT = NO; MACOSX_DEPLOYMENT_TARGET = 13.3; MARKETING_VERSION = 1.0.4; + OTHER_LDFLAGS = ""; + "OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( + "-Xlinker", + "-interposable", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.verse.Nos-dev"; PRODUCT_MODULE_NAME = Nos; PRODUCT_NAME = "$(TARGET_NAME) Dev"; @@ -3309,6 +3317,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -3367,6 +3376,7 @@ MACOSX_DEPLOYMENT_TARGET = 13.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; diff --git a/Nos/Views/AppView.swift b/Nos/Views/AppView.swift index dec6b4de2..90aac180e 100644 --- a/Nos/Views/AppView.swift +++ b/Nos/Views/AppView.swift @@ -5,7 +5,7 @@ import Inject struct AppView: View { @State var showNewPost = false - @State var newPostContents: String? + @State var newPostContents: String? @Environment(AppController.self) var appController @EnvironmentObject private var router: Router @@ -22,15 +22,126 @@ struct AppView: View { var body: some View { ZStack { - switch appController.currentState { - case .loading: - SplashScreenView() - .ignoresSafeArea() - case .onboarding: + if appController.currentState == .onboarding { OnboardingView(completion: appController.completeOnboarding) - case .loggedIn: - tabView - + } else { + TabView(selection: $router.selectedTab) { + if let author = currentUser.author { + HomeTab(user: author) + .tabItem { + VStack { + let text = Text("homeFeed") + if $router.selectedTab.wrappedValue == .home { + Image.tabIconHomeSelected + text + } else { + Image.tabIconHome + text.foregroundColor(.secondaryTxt) + } + } + } + .toolbarBackground(.visible, for: .tabBar) + .toolbarBackground(Color.cardBgBottom, for: .tabBar) + .tag(AppDestination.home) + .onAppear { + // TODO: Move this somewhere better like CurrentUser when it becomes the source of truth + // for who is logged in + if let keyPair = currentUser.keyPair { + analytics.identify( + with: keyPair, + nip05: currentUser.author?.nip05 + ) + crashReporting.identify(with: keyPair) + } + } + } + + DiscoverTab() + .tabItem { + VStack { + let text = Text("discover") + if $router.selectedTab.wrappedValue == .discover { + Image.tabIconEveryoneSelected + text.foregroundColor(.primaryTxt) + } else { + Image.tabIconEveryone + text.foregroundColor(.secondaryTxt) + } + } + } + .toolbarBackground(.visible, for: .tabBar) + .toolbarBackground(Color.cardBgBottom, for: .tabBar) + .tag(AppDestination.discover) + + VStack {} + .tabItem { + VStack { + Image.newPostButton + Text("post") + } + } + .tag(AppDestination.noteComposer(nil)) + + NotificationsView(user: currentUser.author) + .tabItem { + VStack { + let text = Text("notifications") + if $router.selectedTab.wrappedValue == .notifications { + Image.tabIconNotificationsSelected + text.foregroundColor(.primaryTxt) + } else { + Image.tabIconNotifications + text.foregroundColor(.secondaryTxt) + } + } + } + .toolbarBackground(.visible, for: .tabBar) + .toolbarBackground(Color.cardBgBottom, for: .tabBar) + .tag(AppDestination.notifications) + .badge(pushNotificationService.badgeCount) + + if let author = currentUser.author { + ProfileTab(author: author, path: $router.profilePath) + .tabItem { + VStack { + let text = Text("profileTitle") + if $router.selectedTab.wrappedValue == .profile { + Image.tabProfileSelected + text.foregroundColor(.primaryTxt) + } else { + Image.tabProfile + text.foregroundColor(.secondaryTxt) + } + } + } + .toolbarBackground(.visible, for: .tabBar) + .toolbarBackground(Color.cardBgBottom, for: .tabBar) + .tag(AppDestination.profile) + } + } + .onChange(of: router.selectedTab) { _, newTab in + if case let AppDestination.noteComposer(contents) = newTab { + newPostContents = contents + showNewPost = true + router.selectedTab = lastSelectedTab + } else if !showNewPost { + lastSelectedTab = newTab + } + } + .overlay { + if router.isLoading { + ZStack { + Rectangle().fill(.black.opacity(0.4)) + ProgressView() + } + } + } + .sheet(isPresented: $showNewPost, content: { + NoteComposer(initialContents: newPostContents, isPresented: $showNewPost) + .environment(currentUser) + .interactiveDismissDisabled() + }) + SideMenu( menuWidth: 300, menuOpened: router.sideMenuOpened, From ca97a7e4cc2928e82c43b8bb82429eeb8d240c00 Mon Sep 17 00:00:00 2001 From: mplorentz Date: Fri, 27 Dec 2024 13:52:39 -0500 Subject: [PATCH 3/3] Revert changes to AppView --- Nos/Views/AppView.swift | 132 +++------------------------------------- 1 file changed, 9 insertions(+), 123 deletions(-) diff --git a/Nos/Views/AppView.swift b/Nos/Views/AppView.swift index 90aac180e..5bd1d21e0 100644 --- a/Nos/Views/AppView.swift +++ b/Nos/Views/AppView.swift @@ -1,11 +1,10 @@ import SwiftUI import Dependencies -import Inject struct AppView: View { @State var showNewPost = false - @State var newPostContents: String? + @State var newPostContents: String? @Environment(AppController.self) var appController @EnvironmentObject private var router: Router @@ -15,133 +14,21 @@ struct AppView: View { @Dependency(\.userDefaults) private var userDefaults @Environment(CurrentUser.self) var currentUser @Environment(RelayService.self) private var relayService - @ObserveInjection var inject @State private var lastSelectedTab = AppDestination.home @State private var showNIP05Wizard = false var body: some View { ZStack { - if appController.currentState == .onboarding { + switch appController.currentState { + case .loading: + SplashScreenView() + .ignoresSafeArea() + case .onboarding: OnboardingView(completion: appController.completeOnboarding) - } else { - TabView(selection: $router.selectedTab) { - if let author = currentUser.author { - HomeTab(user: author) - .tabItem { - VStack { - let text = Text("homeFeed") - if $router.selectedTab.wrappedValue == .home { - Image.tabIconHomeSelected - text - } else { - Image.tabIconHome - text.foregroundColor(.secondaryTxt) - } - } - } - .toolbarBackground(.visible, for: .tabBar) - .toolbarBackground(Color.cardBgBottom, for: .tabBar) - .tag(AppDestination.home) - .onAppear { - // TODO: Move this somewhere better like CurrentUser when it becomes the source of truth - // for who is logged in - if let keyPair = currentUser.keyPair { - analytics.identify( - with: keyPair, - nip05: currentUser.author?.nip05 - ) - crashReporting.identify(with: keyPair) - } - } - } - - DiscoverTab() - .tabItem { - VStack { - let text = Text("discover") - if $router.selectedTab.wrappedValue == .discover { - Image.tabIconEveryoneSelected - text.foregroundColor(.primaryTxt) - } else { - Image.tabIconEveryone - text.foregroundColor(.secondaryTxt) - } - } - } - .toolbarBackground(.visible, for: .tabBar) - .toolbarBackground(Color.cardBgBottom, for: .tabBar) - .tag(AppDestination.discover) - - VStack {} - .tabItem { - VStack { - Image.newPostButton - Text("post") - } - } - .tag(AppDestination.noteComposer(nil)) - - NotificationsView(user: currentUser.author) - .tabItem { - VStack { - let text = Text("notifications") - if $router.selectedTab.wrappedValue == .notifications { - Image.tabIconNotificationsSelected - text.foregroundColor(.primaryTxt) - } else { - Image.tabIconNotifications - text.foregroundColor(.secondaryTxt) - } - } - } - .toolbarBackground(.visible, for: .tabBar) - .toolbarBackground(Color.cardBgBottom, for: .tabBar) - .tag(AppDestination.notifications) - .badge(pushNotificationService.badgeCount) - - if let author = currentUser.author { - ProfileTab(author: author, path: $router.profilePath) - .tabItem { - VStack { - let text = Text("profileTitle") - if $router.selectedTab.wrappedValue == .profile { - Image.tabProfileSelected - text.foregroundColor(.primaryTxt) - } else { - Image.tabProfile - text.foregroundColor(.secondaryTxt) - } - } - } - .toolbarBackground(.visible, for: .tabBar) - .toolbarBackground(Color.cardBgBottom, for: .tabBar) - .tag(AppDestination.profile) - } - } - .onChange(of: router.selectedTab) { _, newTab in - if case let AppDestination.noteComposer(contents) = newTab { - newPostContents = contents - showNewPost = true - router.selectedTab = lastSelectedTab - } else if !showNewPost { - lastSelectedTab = newTab - } - } - .overlay { - if router.isLoading { - ZStack { - Rectangle().fill(.black.opacity(0.4)) - ProgressView() - } - } - } - .sheet(isPresented: $showNewPost, content: { - NoteComposer(initialContents: newPostContents, isPresented: $showNewPost) - .environment(currentUser) - .interactiveDismissDisabled() - }) - + case .loggedIn: + tabView + SideMenu( menuWidth: 300, menuOpened: router.sideMenuOpened, @@ -160,7 +47,6 @@ struct AppView: View { } .task { await presentNIP05SheetIfNeeded() } .tint(.primaryTxt) - .enableInjection() } private var tabView: some View {