Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit ee1b03a

Browse files
committed
Fetch the correct invite code.
1 parent 141b941 commit ee1b03a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

DuckDuckGo/AppDelegate/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel
221221
syncService?.initializeIfNeeded(isInternalUser: internalUserDecider?.isInternalUser ?? false)
222222
syncService?.scheduler.notifyAppLifecycleEvent()
223223

224-
NetworkProtectionWaitlist.shared.fetchInviteCodeIfAvailable { _ in
224+
NetworkProtectionWaitlist.shared.fetchNetworkProtectionInviteCodeIfAvailable { _ in
225225
// Do nothing when code fetching fails, as the app will try again later
226226
}
227227
}

DuckDuckGo/Menus/MainMenuActions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,12 @@ extension MainViewController {
742742
@IBAction func resetNetworkProtectionWaitlistState(_ sender: Any?) {
743743
NetworkProtectionWaitlist.shared.waitlistStorage.deleteWaitlistState()
744744
UserDefaults().removeObject(forKey: UserDefaultsWrapper<Bool>.Key.networkProtectionTermsAndConditionsAccepted.rawValue)
745+
NotificationCenter.default.post(name: .networkProtectionWaitlistAccessChanged, object: nil)
745746
}
746747

747748
@IBAction func resetNetworkProtectionTermsAndConditionsAcceptance(_ sender: Any?) {
748749
UserDefaults().removeObject(forKey: UserDefaultsWrapper<Bool>.Key.networkProtectionTermsAndConditionsAccepted.rawValue)
750+
NotificationCenter.default.post(name: .networkProtectionWaitlistAccessChanged, object: nil)
749751
}
750752

751753
@IBAction func showNetworkProtectionInviteCodePrompt(_ sender: Any?) {

DuckDuckGo/Waitlist/Waitlist.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ struct NetworkProtectionWaitlist: Waitlist {
203203
assertionFailure("Failed to redeem invite code")
204204
}
205205
}
206+
} else {
207+
assertionFailure("Didn't get error or invite code")
206208
}
207209
}
208210
}

0 commit comments

Comments
 (0)