Fix OPML import issue (#963)
* Fix OPML import issue * Fixes linting errors
This commit is contained in:
		
							parent
							
								
									6245f8b423
								
							
						
					
					
						commit
						bb2dee36b3
					
				| 
						 | 
					@ -8,7 +8,7 @@ import FtPrompt from '../ft-prompt/ft-prompt.vue'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { remote } from 'electron'
 | 
					import { remote } from 'electron'
 | 
				
			||||||
import fs from 'fs'
 | 
					import fs from 'fs'
 | 
				
			||||||
import opmlToJson from 'opml-to-json'
 | 
					import { opmlToJSON } from 'opml-to-json'
 | 
				
			||||||
import ytch from 'yt-channel-info'
 | 
					import ytch from 'yt-channel-info'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const app = remote.app
 | 
					const app = remote.app
 | 
				
			||||||
| 
						 | 
					@ -357,17 +357,7 @@ export default Vue.extend({
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          opmlToJson(data, async (err, json) => {
 | 
					          opmlToJSON(data).then((json) => {
 | 
				
			||||||
            if (err) {
 | 
					 | 
				
			||||||
              console.log(err)
 | 
					 | 
				
			||||||
              console.log('error reading')
 | 
					 | 
				
			||||||
              const message = this.$t('Settings.Data Settings.Invalid subscriptions file')
 | 
					 | 
				
			||||||
              this.showToast({
 | 
					 | 
				
			||||||
                message: `${message}: ${err}`
 | 
					 | 
				
			||||||
              })
 | 
					 | 
				
			||||||
              return
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            let feedData = json.children[0].children
 | 
					            let feedData = json.children[0].children
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (typeof feedData === 'undefined') {
 | 
					            if (typeof feedData === 'undefined') {
 | 
				
			||||||
| 
						 | 
					@ -442,6 +432,13 @@ export default Vue.extend({
 | 
				
			||||||
                this.updateShowProgressBar(false)
 | 
					                this.updateShowProgressBar(false)
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
 | 
					          }).catch((err) => {
 | 
				
			||||||
 | 
					            console.log(err)
 | 
				
			||||||
 | 
					            console.log('error reading')
 | 
				
			||||||
 | 
					            const message = this.$t('Settings.Data Settings.Invalid subscriptions file')
 | 
				
			||||||
 | 
					            this.showToast({
 | 
				
			||||||
 | 
					              message: `${message}: ${err}`
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue