Skip to content
Snippets Groups Projects
Commit 2fd140a7 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Fix bug w/ input current value subject

parent 6c74ba6c
No related branches found
No related tags found
1 merge request!97Fix nickname drawer dependency
......@@ -52,8 +52,10 @@ public final class NicknameController: UIViewController {
.saveButton
.publisher(for: .touchUpInside)
.sink { [unowned self] in
dismiss(animated: true)
completion(viewModel.getInput())
dismiss(animated: true) { [weak self] in
guard let self else { return }
self.completion(self.viewModel.getInput())
}
}.store(in: &cancellables)
}
}
......@@ -26,8 +26,7 @@ final class NicknameViewModel {
}
func didInput(_ string: String) {
let input = stateSubject.value.input
.trimmingCharacters(in: .whitespacesAndNewlines)
let input = string.trimmingCharacters(in: .whitespacesAndNewlines)
stateSubject.value.input = input
stateSubject.value.status = input.count >= 1 ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment