Limit error noty's properly

This commit is contained in:
Natsumi
2021-05-03 23:04:45 +12:00
parent 35b23e0b13
commit 1d826ddf68

View File

@@ -511,7 +511,6 @@ speechSynthesis.getVoices();
// FIXME : extra를 없애줘 // FIXME : extra를 없애줘
API.$throw = function (code, error, extra) { API.$throw = function (code, error, extra) {
Noty.closeAll();
var text = []; var text = [];
if (code > 0) { if (code > 0) {
var status = this.statusCodes[code]; var status = this.statusCodes[code];
@@ -529,7 +528,10 @@ speechSynthesis.getVoices();
} }
text = text.map((s) => escapeTag(s)).join('<br>'); text = text.map((s) => escapeTag(s)).join('<br>');
if (text.length) { if (text.length) {
new Noty({ if (this.errorNoty) {
this.errorNoty.close();
}
this.errorNoty = new Noty({
type: 'error', type: 'error',
text text
}).show(); }).show();