This repository was archived by the owner on Feb 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
WordPressAuthenticator/Unified Auth/View Related/Password Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ private extension PasswordViewController {
276276 tracker. track ( click: . requestMagicLink)
277277 loginFields. meta. emailMagicLinkSource = . login
278278
279- configureViewLoading ( true )
279+ updateLoadingUI ( isRequestingMagicLink : true )
280280 let result = await MagicLinkRequester ( ) . requestMagicLink ( email: loginFields. username, jetpackLogin: loginFields. meta. jetpackLogin)
281281 switch result {
282282 case . success:
@@ -292,7 +292,25 @@ private extension PasswordViewController {
292292 displayError ( error as NSError , sourceTag: sourceTag)
293293 }
294294 }
295- configureViewLoading ( false )
295+ updateLoadingUI ( isRequestingMagicLink: false )
296+ }
297+
298+ func updateLoadingUI( isRequestingMagicLink: Bool ) {
299+ if isRequestingMagicLink {
300+ if isMagicLinkShownAsSecondaryAction {
301+ submitButton? . isEnabled = false
302+ secondaryButton. showActivityIndicator ( true )
303+ } else {
304+ configureViewLoading ( true )
305+ }
306+ } else {
307+ if isMagicLinkShownAsSecondaryAction {
308+ submitButton? . isEnabled = true
309+ secondaryButton. showActivityIndicator ( false )
310+ } else {
311+ configureViewLoading ( false )
312+ }
313+ }
296314 }
297315}
298316
You can’t perform that action at this time.
0 commit comments