Skip to content

Commit

Permalink
fix(auth-form): ui state handling on errors (#2854)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe authored Jan 16, 2024
1 parent c5190be commit 221d6aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/reader-activation/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ window.newspackRAS.push( function ( readerActivation ) {
};

form.endLoginFlow = ( message = null, status = 500, data = null, redirect ) => {
container.setAttribute( 'data-form-status', status );
form.style.opacity = 1;
submitButtons.forEach( button => {
button.disabled = false;
} );
if ( message ) {
const messageNode = document.createElement( 'p' );
messageNode.textContent = message;
Expand All @@ -433,7 +438,6 @@ window.newspackRAS.push( function ( readerActivation ) {
} else {
form.replaceWith( messageContentElement.parentNode );
}
container.setAttribute( 'data-form-status', status );
}
};

Expand Down

0 comments on commit 221d6aa

Please sign in to comment.