Fix toast errors not displaying full message if it contained :
This commit is contained in:
parent
2823c9a36c
commit
2ed398f30f
@ -36,7 +36,12 @@ export default {
|
||||
const { prefix, title } = opt
|
||||
|
||||
return (err = {}) => {
|
||||
const msg = err.message ? (prefix + ': ' + err.message) : prefix
|
||||
// only messages starting with 'notification:' or 'notification.' should be translated
|
||||
if (err.message && err.message.startsWith('notification')) {
|
||||
err.message = this.$t(`notification:${err.message.substring('notification.'.length)}`)
|
||||
}
|
||||
// all other messages should be shown as they are
|
||||
const msg = err.message ? `${prefix}: ${err.message}` : prefix
|
||||
this.toastDanger(msg, title)
|
||||
}
|
||||
},
|
||||
|
||||
@ -36,7 +36,12 @@ export default {
|
||||
const { prefix, title } = opt
|
||||
|
||||
return (err = {}) => {
|
||||
const msg = err.message ? (prefix + ': ' + this.$t(err.message)) : prefix
|
||||
// only messages starting with 'notification:' or 'notification.' should be translated
|
||||
if (err.message && err.message.startsWith('notification')) {
|
||||
err.message = this.$t(`notification:${err.message.substring('notification.'.length)}`)
|
||||
}
|
||||
// all other messages should be shown as they are
|
||||
const msg = err.message ? `${prefix}: ${err.message}` : prefix
|
||||
this.toastDanger(msg, title)
|
||||
}
|
||||
},
|
||||
|
||||
@ -36,7 +36,12 @@ export default {
|
||||
const { prefix, title } = opt
|
||||
|
||||
return (err = {}) => {
|
||||
const msg = err.message ? (prefix + ': ' + this.$t(err.message)) : prefix
|
||||
// only messages starting with 'notification:' or 'notification.' should be translated
|
||||
if (err.message && err.message.startsWith('notification')) {
|
||||
err.message = this.$t(`notification:${err.message.substring('notification.'.length)}`)
|
||||
}
|
||||
// all other messages should be shown as they are
|
||||
const msg = err.message ? `${prefix}: ${err.message}` : prefix
|
||||
this.toastDanger(msg, title)
|
||||
}
|
||||
},
|
||||
|
||||
@ -28,7 +28,12 @@ export default {
|
||||
const { prefix, title } = opt
|
||||
|
||||
return (err = {}) => {
|
||||
const msg = err.message ? (prefix + ': ' + err.message) : prefix
|
||||
// only messages starting with 'notification:' or 'notification.' should be translated
|
||||
if (err.message && err.message.startsWith('notification')) {
|
||||
err.message = this.$t(`notification:${err.message.substring('notification.'.length)}`)
|
||||
}
|
||||
// all other messages should be shown as they are
|
||||
const msg = err.message ? `${prefix}: ${err.message}` : prefix
|
||||
this.toastDanger(msg, title)
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user