From 6c1b5359cfa33fe868dd13be90d6b6052bac84ea Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 31 Jan 2022 17:20:26 +0100 Subject: [PATCH] fix '\n' replace with replaceAll --- app/src/api/errors.js | 2 +- app/src/store/info.js | 2 +- app/src/views/tool/ToolMigrations.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/api/errors.js b/app/src/api/errors.js index 04c94849..c00b7d09 100644 --- a/app/src/api/errors.js +++ b/app/src/api/errors.js @@ -8,7 +8,7 @@ import i18n from '@/i18n' class APIError extends Error { constructor (request, { url, status, statusText }, { error }) { - super(error ? error.replace('\n', '
') : i18n.t('error_server_unexpected')) + super(error ? error.replaceAll('\n', '
') : i18n.t('error_server_unexpected')) const urlObj = new URL(url) this.name = 'APIError' this.code = status diff --git a/app/src/store/info.js b/app/src/store/info.js index 37e09292..67fa9027 100644 --- a/app/src/store/info.js +++ b/app/src/store/info.js @@ -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', '
'), + text: messages[type].replaceAll('\n', '
'), color: type === 'error' ? 'danger' : type } let progressBar = message.text.match(/^\[#*\+*\.*\] > /) diff --git a/app/src/views/tool/ToolMigrations.vue b/app/src/views/tool/ToolMigrations.vue index dc93780e..4e320fcf 100644 --- a/app/src/views/tool/ToolMigrations.vue +++ b/app/src/views/tool/ToolMigrations.vue @@ -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', '
') + migration.disclaimer = migration.disclaimer.replaceAll('\n', '
') this.$set(this.checked, migration.id, null) } })