fix '\n' replace with replaceAll

This commit is contained in:
axolotle 2022-01-31 17:20:26 +01:00
parent 6ae673d4e1
commit 6c1b5359cf
3 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ import i18n from '@/i18n'
class APIError extends Error {
constructor (request, { url, status, statusText }, { error }) {
super(error ? error.replace('\n', '<br>') : i18n.t('error_server_unexpected'))
super(error ? error.replaceAll('\n', '<br>') : i18n.t('error_server_unexpected'))
const urlObj = new URL(url)
this.name = 'APIError'
this.code = status

View file

@ -199,7 +199,7 @@ export default {
'DISPATCH_MESSAGE' ({ state, commit, dispatch }, { request, messages }) {
for (const type in messages) {
const message = {
text: messages[type].replace('\n', '<br>'),
text: messages[type].replaceAll('\n', '<br>'),
color: type === 'error' ? 'danger' : type
}
let progressBar = message.text.match(/^\[#*\+*\.*\] > /)

View file

@ -104,7 +104,7 @@ export default {
this.done = done.length ? done.reverse() : null
pending.forEach(migration => {
if (migration.disclaimer) {
migration.disclaimer = migration.disclaimer.replace('\n', '<br>')
migration.disclaimer = migration.disclaimer.replaceAll('\n', '<br>')
this.$set(this.checked, migration.id, null)
}
})