File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ define([
6262
6363 if ( jqXHR . readyState === 4 ) {
6464 try {
65- $ ( 'body' ) . notification ( 'clearCallbackError' ) ;
6665 jsonObject = JSON . parse ( jqXHR . responseText ) ;
66+
6767 if ( jsonObject . ajaxExpired && jsonObject . ajaxRedirect ) { //eslint-disable-line max-depth
6868 window . location . replace ( jsonObject . ajaxRedirect ) ;
6969 }
@@ -73,10 +73,15 @@ define([
7373
7474 /**
7575 * Error callback.
76+ *
77+ * @param {Object } jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
78+ * @param {String } textStatus
7679 */
77- error : function ( ) {
78- $ ( 'body' ) . notification ( 'clear' )
79- . notification ( 'add' , {
80+ error : function ( jqXHR , textStatus ) {
81+
82+ $ ( 'body' ) . notification ( 'clear' ) ;
83+ if ( jqXHR . readyState !== 0 && textStatus !== 'abort' ) {
84+ $ ( 'body' ) . notification ( 'add' , {
8085 error : true ,
8186 message : $ . mage . __ (
8287 'A technical problem with the server created an error. ' +
@@ -87,11 +92,12 @@ define([
8792 * @param {String } message
8893 */
8994 insertMethod : function ( message ) {
90- var $wrapper = $ ( '<div class="callback" ></div>' ) . html ( message ) ;
95+ var $wrapper = $ ( '<div></div>' ) . html ( message ) ;
9196
9297 $ ( '.page-main-actions' ) . after ( $wrapper ) ;
9398 }
9499 } ) ;
100+ }
95101 }
96102 } ) ;
97103
Original file line number Diff line number Diff line change @@ -77,13 +77,6 @@ define([
7777 */
7878 clear : function ( ) {
7979 $ ( this . placeholder ) . html ( '' ) ;
80- } ,
81-
82- /**
83- * Remove generic callback error message
84- */
85- clearCallbackError : function ( ) {
86- $ ( 'body' ) . find ( '.callback .messages .message-error' ) . parent ( ) . html ( '' ) ;
8780 }
8881 } ) ;
8982
You can’t perform that action at this time.
0 commit comments