update add error message if token turns invalid

This commit is contained in:
シモン 2017-05-02 18:18:02 +09:00
parent 42efc47e2f
commit efaaa63188
2 changed files with 14 additions and 0 deletions

View file

@ -71,6 +71,13 @@
border-radius: 5px;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}
.mt-error {
color: darkred;
background: lightpink;
margin: 5px;
padding: 10px;
}
/* <<< */
/* light theme >>> */

View file

@ -73,6 +73,13 @@ MastodonApi.prototype.listStatuses = function() {
// fix content link target
$('a', this.widget).attr('target', '_blank');
}
,error: function(d_) {
//console.log( d_ );
if(d_.responseJSON) {
$('.mt-header', mapi.widget).html('ERROR');
$('.mt-body', mapi.widget).html( '<div class="mt-error">' + d_.responseJSON.error + '</div>');
}
}
});