mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 16:34:21 +00:00
Don't show error message popups when failing to restore auto-save
Several of the messages talk about clicking the reply links, which seems unhelpful. Also, showing a fullscreen popup on page load seems very unhelpful too. (Itoldyouso that we shouldn't use popups.) Bug: T268069 Change-Id: Id1312cf06200fb45a28b39481a99cc2c96603fa4
This commit is contained in:
parent
fdd7994051
commit
344038ae41
|
@ -37,7 +37,7 @@ function CommentController( $pageContainer, $replyLink, comment ) {
|
||||||
|
|
||||||
if ( storage.get( 'reply/' + comment.id + '/saveable' ) ) {
|
if ( storage.get( 'reply/' + comment.id + '/saveable' ) ) {
|
||||||
mode = storage.get( 'reply/' + comment.id + '/mode' );
|
mode = storage.get( 'reply/' + comment.id + '/mode' );
|
||||||
this.setup( mode );
|
this.setup( mode, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,8 +143,9 @@ CommentController.prototype.onReplyLinkClick = function ( e ) {
|
||||||
* Create and setup the reply widget
|
* Create and setup the reply widget
|
||||||
*
|
*
|
||||||
* @param {string} [mode] Optionally force a mode, 'visual' or 'source'
|
* @param {string} [mode] Optionally force a mode, 'visual' or 'source'
|
||||||
|
* @param {boolean} [hideErrors]
|
||||||
*/
|
*/
|
||||||
CommentController.prototype.setup = function ( mode ) {
|
CommentController.prototype.setup = function ( mode, hideErrors ) {
|
||||||
var comment = this.comment,
|
var comment = this.comment,
|
||||||
commentController = this;
|
commentController = this;
|
||||||
|
|
||||||
|
@ -180,10 +181,12 @@ CommentController.prototype.setup = function ( mode ) {
|
||||||
}, function ( code, data ) {
|
}, function ( code, data ) {
|
||||||
commentController.teardown();
|
commentController.teardown();
|
||||||
|
|
||||||
OO.ui.alert(
|
if ( !hideErrors ) {
|
||||||
code instanceof Error ? code.toString() : controller.getApi().getErrorMessage( data ),
|
OO.ui.alert(
|
||||||
{ size: 'medium' }
|
code instanceof Error ? code.toString() : controller.getApi().getErrorMessage( data ),
|
||||||
);
|
{ size: 'medium' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
logger( {
|
logger( {
|
||||||
action: 'abort',
|
action: 'abort',
|
||||||
|
|
Loading…
Reference in a new issue