From 9a2a366e65cb33a7fe3b96240349d4471c265a06 Mon Sep 17 00:00:00 2001 From: bluelovers Date: Thu, 6 Jun 2024 09:47:52 +0800 Subject: [PATCH] chore: try getFavorites one by one https://github.com/Physton/sd-webui-prompt-all-in-one/issues/328 --- src/src/components/favorite.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/src/components/favorite.vue b/src/src/components/favorite.vue index 19fef45..f34d950 100644 --- a/src/src/components/favorite.vue +++ b/src/src/components/favorite.vue @@ -120,10 +120,10 @@ export default { } }, emits: ['use'], - mounted() { - this.favorites.forEach(item => { - this.getFavorites(item.key) - }) + async mounted() { + for (const item of this.favorites) { + await this.getFavorites(item.key) + } }, methods: { formatTime(time) { @@ -134,7 +134,7 @@ export default { let favoriteItem = this.favorites.find(item => item.key === favoriteKey) if (!favoriteItem) return this.loading = true - this.gradioAPI.getFavorites(favoriteKey).then(res => { + return this.gradioAPI.getFavorites(favoriteKey).then(res => { if(res && res.length > 0){ // 倒序 res.reverse()