From c4afaaaf0618f2a78e0805780ba194f807332766 Mon Sep 17 00:00:00 2001 From: Svallinn <41585298+Svallinn@users.noreply.github.com> Date: Wed, 21 Apr 2021 03:43:40 +0100 Subject: [PATCH] Display error when importing invalid YouTube JSON Closes: #969 Apparently, every importing option had a proper error message displayed on a toast... except this one. Oops. --- .../components/data-settings/data-settings.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index f5068f20..07a70744 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -249,6 +249,10 @@ export default Vue.extend({ const primaryProfile = JSON.parse(JSON.stringify(this.profileList[0])) const subscriptions = [] + this.showToast({ + message: this.$t('Settings.Data Settings.This might take a while, please wait') + }) + this.updateShowProgressBar(true) this.setProgressBarPercentage(0) @@ -258,6 +262,11 @@ export default Vue.extend({ const snippet = channel.snippet if (typeof snippet === 'undefined') { + const message = this.$t('Settings.Data Settings.Invalid subscriptions file') + this.showToast({ + message: message + }) + throw new Error('Unable to find channel data') } @@ -321,12 +330,7 @@ export default Vue.extend({ } const filePath = response.filePaths[0] - - try { - this.handleYoutubeImportFile(filePath) - } catch (err) { - console.log(err) - } + this.handleYoutubeImportFile(filePath) }) },