From bbc06f32b3d3a01eb2d8d324b4ab8bc3161d6075 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Fri, 4 Aug 2023 11:10:12 -0400 Subject: [PATCH] Use for of loop Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com> --- src/components/ImportPage.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/ImportPage.vue b/src/components/ImportPage.vue index 98e269da..eee3e427 100644 --- a/src/components/ImportPage.vue +++ b/src/components/ImportPage.vue @@ -106,13 +106,12 @@ export default { // FreeTube DB else if (text.indexOf("allChannels") != -1) { const lines = text.split("\n"); - for (let i = 0; i < lines.length; i++) { - if (lines[i] !== "") { - const json = JSON.parse(lines[i]); - json.subscriptions.forEach(item => { - this.subscriptions.push(item.id); - }); - } + for (let line of lines) { + if (line === "") continue; + const json = JSON.parse(line); + json.subscriptions.forEach(item => { + this.subscriptions.push(item.id); + }); } } // Google Takeout JSON