Skip to content

Commit

Permalink
Re-Enable Broken Site Toast on iOS (#3244)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

Task/Issue URL:
https://app.asana.com/0/1163321984198618/1207889813347127/f
Tech Design URL:
CC:

**Description**:

<!--
If at any point it isn't actively being worked on/ready for
review/otherwise moving forward strongly consider closing it (or not
opening it in the first place). If you decide not to close it, use Draft
PR while work is still in progress or use `DO NOT MERGE` label to
clarify the PRs state and comment with more information.
-->

**Steps to test this PR**:
1. Got to a page
2. Refresh twice quickly,  you should see the toast prompt.
3. If you do it again it should not show (7 day cool down)
4. By resetting the last shown date user default you can test that
dismissing 3 times will stop showing the prompt for 30 days.

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**Definition of Done (Internal Only)**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

**Copy Testing**:

* [ ] Use of correct apostrophes in new copy, ie `’` rather than `'`

**Orientation Testing**:

* [ ] Portrait
* [ ] Landscape

**Device Testing**:

* [ ] iPhone SE (1st Gen)
* [ ] iPhone 8
* [ ] iPhone X
* [ ] iPhone 14 Pro
* [ ] iPad

**OS Testing**:

* [ ] iOS 15
* [ ] iOS 16
* [ ] iOS 17

**Theme Testing**:

* [ ] Light theme
* [ ] Dark theme

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
  • Loading branch information
SlayterDev authored Aug 22, 2024
1 parent 3f030f0 commit bc43533
Show file tree
Hide file tree
Showing 39 changed files with 829 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Core/DateExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ extension Date {
public func isLessThan48HoursAgo() -> Bool {
self > Date().addingTimeInterval(-48 * 60 * 60)
}

public func isLessThan(daysAgo days: Int) -> Bool {
self > Date().addingTimeInterval(Double(-days) * 24 * 60 * 60)
}
}
3 changes: 2 additions & 1 deletion Core/UserDefaultsPropertyWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ public struct UserDefaultsWrapper<T> {
case didRefreshTimestamp = "com.duckduckgo.ios.userBehavior.didRefreshTimestamp"
case didDoubleRefreshTimestamp = "com.duckduckgo.ios.userBehavior.didDoubleRefreshTimestamp"
case didRefreshCounter = "com.duckduckgo.ios.userBehavior.didRefreshCounter"
case userDidInteractWithBrokenSitePrompt = "com.duckduckgo.ios.userBehavior.userDidInteractWithBrokenSitePrompt"
case lastBrokenSiteToastShownDate = "com.duckduckgo.ios.userBehavior.lastBrokenSiteToastShownDate"
case toastDismissStreakCounter = "com.duckduckgo.ios.userBehavior.toastDismissStreakCounter"

case pixelExperimentInstalled = "com.duckduckgo.ios.pixel.experiment.installed"
case pixelExperimentCohort = "com.duckduckgo.ios.pixel.experiment.cohort"
Expand Down
46 changes: 45 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
0238E44F29C0FAA100615E30 /* FindInPageIOSJSSupport in Frameworks */ = {isa = PBXBuildFile; productRef = 0238E44E29C0FAA100615E30 /* FindInPageIOSJSSupport */; };
025CD01025826035001CD5BB /* FingerprintUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025CCF75257EAFAF001CD5BB /* FingerprintUITest.swift */; };
026DABA428242BC80089E0B5 /* MockUserAgent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 026DABA328242BC80089E0B5 /* MockUserAgent.swift */; };
0283A1FC2C6E3D8100508FBD /* BrokenSitePromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0283A1FA2C6E3D8100508FBD /* BrokenSitePromptView.swift */; };
0283A1FE2C6E3E1B00508FBD /* BrokenSitePromptViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0283A1FB2C6E3D8100508FBD /* BrokenSitePromptViewModel.swift */; };
0283A2012C6E46E300508FBD /* BrokenSitePromptLimiter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0283A2002C6E46E300508FBD /* BrokenSitePromptLimiter.swift */; };
0283A2042C6E572F00508FBD /* BrokenSitePromptLimiterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0283A2032C6E572F00508FBD /* BrokenSitePromptLimiterTests.swift */; };
02BA15B126A89ECA00472DD7 /* ios-config.json in Resources */ = {isa = PBXBuildFile; fileRef = 02BA15B026A89ECA00472DD7 /* ios-config.json */; };
02CA904924F6BFE700D41DDF /* navigatorsharepatch.js in Resources */ = {isa = PBXBuildFile; fileRef = 02CA904824F6BFE700D41DDF /* navigatorsharepatch.js */; };
02CA904B24F6C11A00D41DDF /* NavigatorSharePatchUserScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02CA904A24F6C11A00D41DDF /* NavigatorSharePatchUserScript.swift */; };
Expand Down Expand Up @@ -1246,6 +1250,10 @@
025CCFE22582601C001CD5BB /* FingerprintingUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FingerprintingUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
025CCFE62582601C001CD5BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
026DABA328242BC80089E0B5 /* MockUserAgent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockUserAgent.swift; sourceTree = "<group>"; };
0283A1FA2C6E3D8100508FBD /* BrokenSitePromptView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptView.swift; sourceTree = "<group>"; };
0283A1FB2C6E3D8100508FBD /* BrokenSitePromptViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptViewModel.swift; sourceTree = "<group>"; };
0283A2002C6E46E300508FBD /* BrokenSitePromptLimiter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptLimiter.swift; sourceTree = "<group>"; };
0283A2032C6E572F00508FBD /* BrokenSitePromptLimiterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptLimiterTests.swift; sourceTree = "<group>"; };
02BA15B026A89ECA00472DD7 /* ios-config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "ios-config.json"; sourceTree = "<group>"; };
02C4BC3127C3F9B600C40026 /* AppPrivacyConfigurationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppPrivacyConfigurationTests.swift; sourceTree = "<group>"; };
02CA904824F6BFE700D41DDF /* navigatorsharepatch.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = navigatorsharepatch.js; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2596,6 +2604,7 @@
CB18F2712AF6D4E400A0F8FE /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB1AEFB02799AA940031AE3D /* SwiftUICollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUICollectionViewCell.swift; sourceTree = "<group>"; };
CB1FAE472AF6D59B003F452F /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB2283F22BD79FC20057DD0A /* BrokenSitePromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptView.swift; sourceTree = "<group>"; };
CB24F70E29A3EB15006DCC58 /* AppConfigurationURLProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppConfigurationURLProvider.swift; path = ../Core/AppConfigurationURLProvider.swift; sourceTree = "<group>"; };
CB258D0C29A4CD0500DEBA24 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
CB258D0F29A4D0FD00DEBA24 /* ConfigurationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationManager.swift; sourceTree = "<group>"; };
Expand All @@ -2608,6 +2617,7 @@
CB48D3312B90CE9F00631D8B /* UserBehaviorMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserBehaviorMonitor.swift; sourceTree = "<group>"; };
CB48D3352B90CECD00631D8B /* UserBehaviorMonitorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserBehaviorMonitorTests.swift; sourceTree = "<group>"; };
CB5038622AF6D563007FD69F /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB5418622BD90CD000C2CD26 /* BrokenSitePromptViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrokenSitePromptViewModel.swift; sourceTree = "<group>"; };
CB6ABD002AF6D52B004A8224 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB6CE65B2AF6D4EE00119848 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB7407BC2AF6D56D0090A41C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3052,6 +3062,33 @@
path = FingerprintingUITests;
sourceTree = "<group>";
};
0283A1F82C6E3C3100508FBD /* Recovered References */ = {
isa = PBXGroup;
children = (
CB2283F22BD79FC20057DD0A /* BrokenSitePromptView.swift */,
CB5418622BD90CD000C2CD26 /* BrokenSitePromptViewModel.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
};
0283A1F92C6E3D4200508FBD /* BrokenSitePrompt */ = {
isa = PBXGroup;
children = (
0283A1FA2C6E3D8100508FBD /* BrokenSitePromptView.swift */,
0283A1FB2C6E3D8100508FBD /* BrokenSitePromptViewModel.swift */,
0283A2002C6E46E300508FBD /* BrokenSitePromptLimiter.swift */,
);
name = BrokenSitePrompt;
sourceTree = "<group>";
};
0283A2022C6E56F400508FBD /* BrokenSitePrompt */ = {
isa = PBXGroup;
children = (
0283A2032C6E572F00508FBD /* BrokenSitePromptLimiterTests.swift */,
);
name = BrokenSitePrompt;
sourceTree = "<group>";
};
02BA15AD26A89DE100472DD7 /* PrivacyConfiguration */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3992,6 +4029,7 @@
83ED3B8D1FA8E63700B47556 /* README.md */,
83ED3B8C1FA8E61D00B47556 /* ManualTestsScript.md */,
85A313962028E78A00327D00 /* release_notes.txt */,
0283A1F82C6E3C3100508FBD /* Recovered References */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -4026,6 +4064,7 @@
1E908BED29827C480008C8F3 /* Autoconsent */,
F44D279327F331930037F371 /* Autofill */,
F1668BCC1E798025008CBA04 /* Bookmarks */,
0283A1F92C6E3D4200508FBD /* BrokenSitePrompt */,
9830A05725ED0C5D00DB64DE /* BrowsingMenu */,
CB258D1129A4F1BB00DEBA24 /* Configuration */,
B652DF02287C01EE00C12A9C /* ContentBlocking */,
Expand Down Expand Up @@ -5393,6 +5432,7 @@
981FED7222045FFA008488D7 /* AutoClear */,
1E1D8B5B2994FF7800C96994 /* Autoconsent */,
F40F843228C92B1C0081AE75 /* Autofill */,
0283A2022C6E56F400508FBD /* BrokenSitePrompt */,
98559FD0267099F400A83094 /* ContentBlocker */,
31C138A127A334F600FFD4B2 /* Downloads */,
D62EC3B72C24695800FC9D04 /* DuckPlayer */,
Expand Down Expand Up @@ -7015,6 +7055,7 @@
1D200C992BA3176D00108701 /* SettingsOthersView.swift in Sources */,
31DD208427395A5A008FB313 /* VoiceSearchHelper.swift in Sources */,
9874F9EE2187AFCE00CAF33D /* Themable.swift in Sources */,
0283A1FC2C6E3D8100508FBD /* BrokenSitePromptView.swift in Sources */,
F44D279E27F331BB0037F371 /* AutofillLoginPromptViewModel.swift in Sources */,
3151F0F02735802800226F58 /* VoiceSearchViewController.swift in Sources */,
D6FEB8B32B74990D00C3615F /* HeadlessWebViewNavCoordinator.swift in Sources */,
Expand Down Expand Up @@ -7276,6 +7317,7 @@
85DDE0402AC6FF65006ABCA2 /* MainView.swift in Sources */,
980891A72237D5D800313A70 /* FeedbackPresenter.swift in Sources */,
989B337522D7EF2100437824 /* EmptyCollectionReusableView.swift in Sources */,
0283A1FE2C6E3E1B00508FBD /* BrokenSitePromptViewModel.swift in Sources */,
8524CC94246C5C8900E59D45 /* DaxDialogViewController.swift in Sources */,
851672CF2BED1F9500592F24 /* HistoryMessageManager.swift in Sources */,
F42EF9312614BABE00101FB9 /* ActionSheetDaxDialogViewController.swift in Sources */,
Expand Down Expand Up @@ -7403,6 +7445,7 @@
C13F3F6A2B7F883A0083BE40 /* AuthConfirmationPromptViewController.swift in Sources */,
851624C72B96389D002D5CD7 /* HistoryDebugViewController.swift in Sources */,
8540BBA22440857A00017FE4 /* PreserveLoginsWorker.swift in Sources */,
0283A2012C6E46E300508FBD /* BrokenSitePromptLimiter.swift in Sources */,
85DFEDF924CF3D0E00973FE7 /* TabsBarCell.swift in Sources */,
851672D32BED23FE00592F24 /* AutocompleteViewModel.swift in Sources */,
8562CE152B9B645C00E1D399 /* CachedBookmarkSuggestions.swift in Sources */,
Expand Down Expand Up @@ -7601,6 +7644,7 @@
6F934F862C58DB00008364E4 /* NewTabPageSettingsPersistentStorageTests.swift in Sources */,
987130C5294AAB9F00AB05E0 /* BookmarkEditorViewModelTests.swift in Sources */,
BDFF03262BA3DA4900F324C9 /* NetworkProtectionFeatureVisibilityTests.swift in Sources */,
0283A2042C6E572F00508FBD /* BrokenSitePromptLimiterTests.swift in Sources */,
D62EC3BA2C246A7000FC9D04 /* YoutublePlayerNavigationHandlerTests.swift in Sources */,
9FEA22302C325125006B03BF /* AnimatableTypingTextModelTests.swift in Sources */,
8341D807212D5E8D000514C2 /* HashExtensionTest.swift in Sources */,
Expand Down Expand Up @@ -10539,7 +10583,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 185.0.1;
version = 185.1.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "1354d1aec247fd569c69744bb2722f24e16f0bfb",
"version" : "185.0.1"
"revision" : "8b62a829899f1e635aa91deded017ed72be0d4a1",
"version" : "185.1.0"
}
},
{
Expand Down
106 changes: 106 additions & 0 deletions DuckDuckGo/BrokenSitePromptLimiter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//
// BrokenSitePromptLimiter.swift
// DuckDuckGo
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
import Core
import BrowserServicesKit

protocol BrokenSitePromptLimiterStoring {
var lastToastShownDate: Date { get set }
var toastDismissStreakCounter: Int { get set }
}

final class BrokenSitePromptLimiterStore: BrokenSitePromptLimiterStoring {
@UserDefaultsWrapper(key: .lastBrokenSiteToastShownDate, defaultValue: .distantPast)
var lastToastShownDate: Date

@UserDefaultsWrapper(key: .toastDismissStreakCounter, defaultValue: 0)
var toastDismissStreakCounter: Int
}

final class BrokenSitePromptLimiter {

struct BrokenSitePromptLimiterSettings: Codable {
let maxDismissStreak: Int
let dismissStreakResetDays: Int
let coolDownDays: Int
}

private var lastToastShownDate: Date {
get { store.lastToastShownDate }
set { store.lastToastShownDate = newValue }
}

private var toastDismissStreakCounter: Int {
get { store.toastDismissStreakCounter }
set { store.toastDismissStreakCounter = newValue }
}

private var privacyConfigManager: PrivacyConfigurationManaging
private var store: BrokenSitePromptLimiterStoring

init(privacyConfigManager: PrivacyConfigurationManaging = ContentBlocking.shared.privacyConfigurationManager,
store: BrokenSitePromptLimiterStoring = BrokenSitePromptLimiterStore()) {
self.privacyConfigManager = privacyConfigManager
self.store = store
}

private func getSettingsFromConfig() -> BrokenSitePromptLimiterSettings {
let settings = privacyConfigManager.privacyConfig.settings(for: .brokenSitePrompt)

// Get settings from config or fallback to standard defaults
return BrokenSitePromptLimiterSettings(
maxDismissStreak: settings["maxDismissStreak"] as? Int ?? 3,
dismissStreakResetDays: settings["dismissStreakResetDays"] as? Int ?? 30,
coolDownDays: settings["coolDownDays"] as? Int ?? 7
)
}

/// If it has been `dismissStreakResetDays` or more since the last time we showed the prompt, reset the dismiss counter to 0
private func resetDismissStreakIfNeeded(dismissStreakResetDays: Int) {
if !lastToastShownDate.isLessThan(daysAgo: dismissStreakResetDays) {
toastDismissStreakCounter = 0
}
}

public func shouldShowToast() -> Bool {
guard privacyConfigManager.privacyConfig.isEnabled(featureKey: .brokenSitePrompt) else { return false }

let settings = getSettingsFromConfig()

resetDismissStreakIfNeeded(dismissStreakResetDays: settings.dismissStreakResetDays)
guard toastDismissStreakCounter < settings.maxDismissStreak else { return false } // Don't show the toast if the user dismissed it more than `maxDismissStreak` times in a row
guard !lastToastShownDate.isLessThan(daysAgo: settings.coolDownDays) else { return false } // Only show the toast once per `coolDownDays` days

return true
}

public func didShowToast() {
lastToastShownDate = Date()
}

public func didDismissToast() {
toastDismissStreakCounter += 1
}

public func didOpenReport() {
toastDismissStreakCounter = 0
}

}
61 changes: 61 additions & 0 deletions DuckDuckGo/BrokenSitePromptView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// BrokenSitePromptView.swift
// DuckDuckGo
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import SwiftUI
import DuckUI
import DesignResourcesKit

struct BrokenSitePromptView: View {

let viewModel: BrokenSitePromptViewModel

var body: some View {
VStack {
VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading) {
Text(UserText.siteNotWorkingTitle)
.font(Font(uiFont: .daxSubheadSemibold()))
Text(UserText.siteNotWorkingSubtitle)
.font(Font(uiFont: .daxSubheadRegular()))
}
HStack {
Spacer()
Button(UserText.siteNotWorkingDismiss, action: viewModel.onDidDismiss)
.buttonStyle(GhostButtonStyle())
.fixedSize()
Button(UserText.siteNotWorkingWebsiteIsBroken, action: viewModel.onDidSubmit)
.buttonStyle(PrimaryButtonStyle(compact: true))
.fixedSize()
}
}
.padding(EdgeInsets(top: 12, leading: 16, bottom: 4, trailing: 16))
Color(designSystemColor: .lines).frame(height: 1 / UIScreen.main.scale)
}
.background(Color(designSystemColor: .panel))
}

}

#Preview {

let viewModel = BrokenSitePromptViewModel(onDidDismiss: {},
onDidSubmit: {})
return BrokenSitePromptView(viewModel: viewModel)

}
32 changes: 32 additions & 0 deletions DuckDuckGo/BrokenSitePromptViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// BrokenSitePromptViewModel.swift
// DuckDuckGo
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation

final class BrokenSitePromptViewModel {

let onDidDismiss: () -> Void
let onDidSubmit: () -> Void

init(onDidDismiss: @escaping () -> Void, onDidSubmit: @escaping () -> Void) {
self.onDidDismiss = onDidDismiss
self.onDidSubmit = onDidSubmit
}

}
Loading

0 comments on commit bc43533

Please sign in to comment.