improved multi url import

This commit is contained in:
vabene1111
2023-07-22 11:18:06 +02:00
parent b30f8c245e
commit d5ba2e6716

View File

@@ -675,12 +675,26 @@ export default {
*/ */
autoImport: function () { autoImport: function () {
this.collapse_visible.import = true this.collapse_visible.import = true
this.website_url_list.split('\n').forEach(r => { let url_list = this.website_url_list.split('\n').filter(x => x.trim() !== '')
this.loadRecipe(r, true, undefined).then((recipe_json) => { if (url_list.length > 0) {
let url = url_list.shift()
this.website_url_list = url_list.join('\n')
this.loadRecipe(url, true, undefined).then((recipe_json) => {
this.importRecipe('multi_import', recipe_json, true) this.importRecipe('multi_import', recipe_json, true)
setTimeout(() => {
this.autoImport()
}, 2000)
}).catch((err) => {
}) })
}) } else {
this.website_url_list = '' this.import_loading = false
this.loading = false
}
}, },
/** /**
* Import recipes with uploaded files and app integration * Import recipes with uploaded files and app integration