|
@@ -23,6 +23,7 @@ struct LauncherRootView: View {
|
|
|
@State private var showingPremiumScreen = false
|
|
@State private var showingPremiumScreen = false
|
|
|
@State private var showingCreateAppSheet = false
|
|
@State private var showingCreateAppSheet = false
|
|
|
@State private var previouslyPremiumUnlocked = false
|
|
@State private var previouslyPremiumUnlocked = false
|
|
|
|
|
+ @State private var isPromoBannerVisible = true
|
|
|
@State private var lastKnownPremiumProductID: PremiumProductID?
|
|
@State private var lastKnownPremiumProductID: PremiumProductID?
|
|
|
@State private var ratingPromptTask: Task<Void, Never>?
|
|
@State private var ratingPromptTask: Task<Void, Never>?
|
|
|
@State private var customApps: [LauncherApp] = []
|
|
@State private var customApps: [LauncherApp] = []
|
|
@@ -153,19 +154,24 @@ struct LauncherRootView: View {
|
|
|
)
|
|
)
|
|
|
.padding(.top, 8)
|
|
.padding(.top, 8)
|
|
|
|
|
|
|
|
- PromoBanner(
|
|
|
|
|
- isPremiumUnlocked: premiumStore.isPremiumUnlocked,
|
|
|
|
|
- activePremiumProductID: premiumStore.activePremiumProductID ?? lastKnownPremiumProductID,
|
|
|
|
|
- onCloseTap: {
|
|
|
|
|
- if !premiumStore.isPremiumUnlocked {
|
|
|
|
|
- showingPremiumScreen = true
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- onUpgradeTap: { showingPremiumScreen = true },
|
|
|
|
|
- onManageSubscriptionTap: { openManageSubscriptions() }
|
|
|
|
|
- )
|
|
|
|
|
- .padding(.bottom, 8)
|
|
|
|
|
- .zIndex(1)
|
|
|
|
|
|
|
+ let shouldShowPromoBanner = !premiumStore.isPremiumUnlocked || isPromoBannerVisible
|
|
|
|
|
+ if shouldShowPromoBanner {
|
|
|
|
|
+ PromoBanner(
|
|
|
|
|
+ isPremiumUnlocked: premiumStore.isPremiumUnlocked,
|
|
|
|
|
+ activePremiumProductID: premiumStore.activePremiumProductID ?? lastKnownPremiumProductID,
|
|
|
|
|
+ onCloseTap: {
|
|
|
|
|
+ if premiumStore.isPremiumUnlocked {
|
|
|
|
|
+ isPromoBannerVisible = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showingPremiumScreen = true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onUpgradeTap: { showingPremiumScreen = true },
|
|
|
|
|
+ onManageSubscriptionTap: { openManageSubscriptions() }
|
|
|
|
|
+ )
|
|
|
|
|
+ .padding(.bottom, 8)
|
|
|
|
|
+ .zIndex(1)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
appsPage
|
|
appsPage
|
|
|
}
|
|
}
|
|
@@ -211,6 +217,7 @@ struct LauncherRootView: View {
|
|
|
}
|
|
}
|
|
|
.onAppear {
|
|
.onAppear {
|
|
|
previouslyPremiumUnlocked = premiumStore.isPremiumUnlocked
|
|
previouslyPremiumUnlocked = premiumStore.isPremiumUnlocked
|
|
|
|
|
+ isPromoBannerVisible = true
|
|
|
if let active = premiumStore.activePremiumProductID {
|
|
if let active = premiumStore.activePremiumProductID {
|
|
|
lastKnownPremiumProductID = active
|
|
lastKnownPremiumProductID = active
|
|
|
}
|
|
}
|