in HuggingChat-Mac/Models/CoordinatorModel.swift [47:71]
func validateSignup(code: String, state: String) {
// DispatchQueue.main.async {
// self.delegate?.dismissController(animated: true)
// }
NetworkService.validateSignIn(code: code, state: state)
.receive(on: DispatchQueue.main)
.sink { completion in
switch completion {
case .finished:
print("Connected")
// self?.showInfo(info: "Connected")
case .failure(let error):
print("Could not validate sign in", error.localizedDescription)
// self?.showError(error: error)
}
} receiveValue: { _ in
print("SignIn Validated")
HuggingChatSession.shared.refreshLoginState()
UserDefaults.standard.set(true, forKey: "userLoggedIn")
// self?.conversationViewModel.reset()
// self?.loadMostRecentConversation()
// self?.delegate?.removeRequestLoginPopupIfNeeded()
}.store(in: &cancellables)
}