From a9305f26c5dae7f2431ced9668feb9e07dbc10f5 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Fri, 4 Aug 2023 08:35:02 -0700 Subject: [PATCH] Fix: FreeTube Subscription Import (#2744) * Fix: FreeTube Subscription Import * Use for of loop Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com> --------- Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com> --- src/components/ImportPage.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ImportPage.vue b/src/components/ImportPage.vue index 9e598018..eee3e427 100644 --- a/src/components/ImportPage.vue +++ b/src/components/ImportPage.vue @@ -105,10 +105,14 @@ export default { } // FreeTube DB else if (text.indexOf("allChannels") != -1) { - const json = JSON.parse(text); - json.subscriptions.forEach(item => { - this.subscriptions.push(item.id); - }); + const lines = text.split("\n"); + 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 else if (text.indexOf("contentDetails") != -1) {