From eea4965974bb5526aa11148d12eb4937c7b516f3 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 13 Feb 2022 19:36:32 +0000 Subject: [PATCH] Replace substr to slice. --- src/components/ImportPage.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ImportPage.vue b/src/components/ImportPage.vue index 0d86d5a0..45bf0070 100644 --- a/src/components/ImportPage.vue +++ b/src/components/ImportPage.vue @@ -84,7 +84,7 @@ export default { const xmlDoc = parser.parseFromString(text, "text/xml"); xmlDoc.querySelectorAll("outline[xmlUrl]").forEach(item => { const url = item.getAttribute("xmlUrl"); - const id = url.substr(-24); + const id = url.slice(-24); this.subscriptions.push(id); }); } @@ -95,7 +95,7 @@ export default { .filter(item => item.service_id == 0) .forEach(item => { const url = item.url; - const id = url.substr(-24); + const id = url.slice(-24); this.subscriptions.push(id); }); } @@ -125,7 +125,7 @@ export default { const lines = text.split("\n"); for (let i = 1; i < lines.length; i++) { const line = lines[i]; - const id = line.substr(0, line.indexOf(",")); + const id = line.slice(0, line.indexOf(",")); if (id.length === 24) this.subscriptions.push(id); } }