forked from zelo72/mastodon-ios
chore: fill email in MastodonResendEmailViewModelNavigationDelegateShim
This commit is contained in:
parent
fa4b349e06
commit
74c19c9746
|
@ -59,13 +59,6 @@ extension MastodonResendEmailViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MastodonResendEmailViewController {
|
|
||||||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
|
||||||
let scriptString = "document.getElementById('user_email').value = '\(self.viewModel.email)';"
|
|
||||||
webView.evaluateJavaScript(scriptString)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extension MastodonResendEmailViewController {
|
extension MastodonResendEmailViewController {
|
||||||
@objc private func cancelBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
@objc private func cancelBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
||||||
dismiss(animated: true, completion: nil)
|
dismiss(animated: true, completion: nil)
|
||||||
|
|
|
@ -27,7 +27,11 @@ final class MastodonResendEmailViewModelNavigationDelegateShim: NSObject {
|
||||||
extension MastodonResendEmailViewModelNavigationDelegateShim: WKNavigationDelegate {
|
extension MastodonResendEmailViewModelNavigationDelegateShim: WKNavigationDelegate {
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
||||||
|
guard let email = self.viewModel?.email else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let scriptString = "document.getElementById('user_email').value = '\(email)';"
|
||||||
|
webView.evaluateJavaScript(scriptString)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue