chore: try getFavorites one by one

https://github.com/Physton/sd-webui-prompt-all-in-one/issues/328
This commit is contained in:
bluelovers
2024-06-06 09:47:52 +08:00
parent d806005dad
commit 9a2a366e65

View File

@@ -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()