Skip to content

Commit

Permalink
Reverting accidental push to main (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
afterxleep authored Apr 11, 2024
1 parent 174f46f commit 68d6b0b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 63 deletions.
6 changes: 1 addition & 5 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@
D66F683D2BB333C100AE93E2 /* SubscriptionContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */; };
D670E5BB2BB6A75300941A42 /* SubscriptionNavigationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */; };
D670E5BD2BB6AA0000941A42 /* View+AppearModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */; };
D67969112BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67969102BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift */; };
D68A21442B7EC08500BB372E /* SubscriptionExternalLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */; };
D68A21462B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */; };
D68DF81C2B58302E0023DBEA /* SubscriptionRestoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68DF81B2B58302E0023DBEA /* SubscriptionRestoreView.swift */; };
Expand Down Expand Up @@ -2544,7 +2543,6 @@
D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionContainerView.swift; sourceTree = "<group>"; };
D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionNavigationCoordinator.swift; sourceTree = "<group>"; };
D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+AppearModifiers.swift"; sourceTree = "<group>"; };
D67969102BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionContainerViewModel.swift; sourceTree = "<group>"; };
D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkView.swift; sourceTree = "<group>"; };
D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkViewModel.swift; sourceTree = "<group>"; };
D68DF81B2B58302E0023DBEA /* SubscriptionRestoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionRestoreView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4771,14 +4769,13 @@
D664C7932B289AA000CBFA76 /* ViewModel */ = {
isa = PBXGroup;
children = (
D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */,
D67969102BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift */,
D664C7942B289AA000CBFA76 /* SubscriptionFlowViewModel.swift */,
D68DF81D2B5830380023DBEA /* SubscriptionRestoreViewModel.swift */,
D668D9262B6937D2008E2FF2 /* SubscriptionITPViewModel.swift */,
D64648AE2B5993890033090B /* SubscriptionEmailViewModel.swift */,
D652498D2B515A6A0056B0DE /* SubscriptionSettingsViewModel.swift */,
D6BFCB602B7525160051FF81 /* SubscriptionPIRViewModel.swift */,
D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
Expand Down Expand Up @@ -6950,7 +6947,6 @@
F194FAED1F14E2B3009B4DF8 /* UIFontExtension.swift in Sources */,
F1CDD3F21F16911700BE0581 /* AboutViewControllerOld.swift in Sources */,
98F0FC2021FF18E700CE77AB /* AutoClearSettingsViewController.swift in Sources */,
D67969112BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift in Sources */,
027F487A2A4B66CD001A1C6C /* AppTPFAQViewModel.swift in Sources */,
F1E90C201E678E7C005E7E21 /* HomeControllerDelegate.swift in Sources */,
F17922DE1E7192E6006E3D97 /* SuggestionTableViewCell.swift in Sources */,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ final class SubscriptionEmailViewModel: ObservableObject {

private func cleanUp() {
canGoBackCancellable?.cancel()
subFeature.cleanup()
cancellables.removeAll()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ final class SubscriptionFlowViewModel: ObservableObject {
transactionStatusTimer?.invalidate()
canGoBackCancellable?.cancel()
urlCancellable?.cancel()
subFeature.cleanup()
cancellables.removeAll()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ final class SubscriptionRestoreViewModel: ObservableObject {
}

private func cleanUp() {
subFeature.cleanup()
cancellables.removeAll()
}

Expand Down
18 changes: 8 additions & 10 deletions DuckDuckGo/Subscription/Views/SubscriptionContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,18 @@ struct SubscriptionContainerView: View {
@Environment(\.dismiss) var dismiss
@EnvironmentObject var subscriptionNavigationCoordinator: SubscriptionNavigationCoordinator
@State private var currentViewState: CurrentView
private let viewModel: SubscriptionContainerViewModel
private let flowViewModel: SubscriptionFlowViewModel
private let restoreViewModel: SubscriptionRestoreViewModel
private let emailViewModel: SubscriptionEmailViewModel

init(currentView: CurrentView,
viewModel: SubscriptionContainerViewModel = SubscriptionContainerViewModel()) {

init(currentView: CurrentView) {
_currentViewState = State(initialValue: currentView)
self.viewModel = viewModel
let userScript = viewModel.userScript
let subFeature = viewModel.subFeature
flowViewModel = viewModel.flow
restoreViewModel = viewModel.restore
emailViewModel = viewModel.email

let userScript = SubscriptionPagesUserScript()
let subFeature = SubscriptionPagesUseSubscriptionFeature()
flowViewModel = SubscriptionFlowViewModel(userScript: userScript, subFeature: subFeature)
restoreViewModel = SubscriptionRestoreViewModel(userScript: userScript, subFeature: subFeature)
emailViewModel = SubscriptionEmailViewModel(userScript: userScript, subFeature: subFeature)
}

var body: some View {
Expand Down

0 comments on commit 68d6b0b

Please sign in to comment.