Skip to content

Commit

Permalink
Fixed retain cycles on DatabasePresenter [SDK-2360] (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket authored Feb 26, 2021
1 parent 93a01af commit 2d57d03
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 2d57d03

Please sign in to comment.