mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 22:58:19 -05:00
improved multi url import
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user