mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Refactoring
This commit is contained in:
1 parent
093390084f
commit
d46b62d3de
10 files changed
+35
-63
No files matched your search
@@ -12,14 +12,14 @@ import StoreKit
|
||||
struct ContentView: View {
|
||||
|
||||
@ObservedObject var luiSettings = LUISettings.sharedInstance
|
||||
@ObservedObject var settings = Settings.sharedInstance
|
||||
@ObservedObject var iapManager = IAPManager.sharedInstance
|
||||
|
||||
var body: some View {
|
||||
AppRootView(isPlus: $settings.gotPlus, phoneView: {
|
||||
AppRootView(phoneView: {
|
||||
DeviceListView()
|
||||
.environment(\.sheetActive, isShareExtension())
|
||||
}, settingsView: {
|
||||
CustomSection(header: settings.gotPlus ? "" : "General", footer: "TrustedDevicesFooterShort") {
|
||||
CustomSection(header: iapManager.plusVersionState ? "" : "General", footer: "TrustedDevicesFooterShort") {
|
||||
LUIButton {
|
||||
FileManager.default.openDocumentFolder()
|
||||
} label: {
|
||||
@@ -46,13 +46,10 @@ struct DeviceListView: View {
|
||||
#if !EXTENSION
|
||||
@StateObject var receiveModel = ReceiveModel(controlPlusScreen: { show in
|
||||
log("[DeviceListView] Setting showPlusScreen to \(show)")
|
||||
errorVibration()
|
||||
DeviceListViewModel.sharedInstance.showPlusScreen = show
|
||||
presentPaywall()
|
||||
})
|
||||
#endif
|
||||
|
||||
@ObservedObject var model = DeviceListViewModel.sharedInstance
|
||||
|
||||
@Environment(\.scenePhase) var scenePhase
|
||||
@Environment(\.sheetActive) var sheetActive
|
||||
@ObservedObject var nearbyConnectionManager = NearbyConnectionManager.shared
|
||||
@@ -219,9 +216,6 @@ struct DeviceListView: View {
|
||||
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
||||
}
|
||||
}
|
||||
#if !EXTENSION
|
||||
.modifier(PlusVersionSheetModifier(sheetActive: $model.showPlusScreen, isPlusVersion: $settings.gotPlus))
|
||||
#endif
|
||||
.animation(.smooth, value: nearbyConnectionManager.hasLocalNetworkPermission)
|
||||
.animation(.smooth, value: nearbyConnectionManager.isConnectedToLocalNetwork)
|
||||
.navigationBarItems(trailing: ZStack {
|
||||
@@ -236,13 +230,6 @@ struct DeviceListView: View {
|
||||
}
|
||||
|
||||
|
||||
final class DeviceListViewModel: SharedInstance {
|
||||
static var sharedInstance = DeviceListViewModel()
|
||||
|
||||
@Published var showPlusScreen = false
|
||||
}
|
||||
|
||||
|
||||
struct DeviceFilePickerButton: View {
|
||||
|
||||
let device: RemoteDeviceInfo
|
||||
|
||||
@@ -15,7 +15,7 @@ public struct LocalNetworkPermissionView: View {
|
||||
|
||||
public var body: some View {
|
||||
|
||||
PermissionView(title: "introduction_local_network_access", symbol: "", subtitle: "introduction_local_network_access_description".localized(with: "introduction_continue".localized()), permissionAction: {
|
||||
PermissionView(title: "introduction_local_network_access", watchSymbol: "", subtitle: "introduction_local_network_access_description".localized(with: "introduction_continue".localized()), permissionAction: {
|
||||
|
||||
if requestedLocalNetworkAccess {
|
||||
// Something went wrong, user pressed again on continue. In this case, just continue with setup
|
||||
|
||||
Reference in new issue
Block a user