Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed retain cycles on DatabasePresenter [SDK-2360] #660

Merged
merged 2 commits into from
Feb 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lock/DatabasePresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class DatabasePresenter: Presentable, Loggable {
let form = view.form
form?.onValueChange = self.handleInput

form?.onSubmit = { input in
form?.onSubmit = { [weak form] input in
form?.onValueChange(input)

guard let attribute = self.getUserAttribute(from: input.type) else { return false }
Expand All @@ -114,7 +114,7 @@ class DatabasePresenter: Presentable, Loggable {
}

let action = { [weak form] (button: PrimaryButton) in
guard let isValid = view.form?.shouldSubmit(), isValid else { return }
guard let isValid = form?.shouldSubmit(), isValid else { return }

self.messagePresenter?.hideCurrent()
self.logger.info("Perform login for email: \(self.authenticator.email.verbatim())")
Expand Down Expand Up @@ -182,7 +182,7 @@ class DatabasePresenter: Presentable, Loggable {
let form = view.form
view.form?.onValueChange = self.handleInput

form?.onSubmit = { input in
form?.onSubmit = { [weak form] input in
form?.onValueChange(input)

guard let attribute = self.getUserAttribute(from: input.type) else { return false }
Expand All @@ -196,7 +196,7 @@ class DatabasePresenter: Presentable, Loggable {
}

let action = { [weak form, weak view] (button: PrimaryButton) in
guard let isValid = view?.form?.shouldSubmit(), isValid else { return }
guard let isValid = form?.shouldSubmit(), isValid else { return }

self.messagePresenter?.hideCurrent()
self.logger.info("Perform sign up for email \(self.creator.email.verbatim())")
Expand Down