add error handling to updateCache for saved-feeds (#878)
parent
c060cd4158
commit
71af9fd04b
|
@ -78,7 +78,13 @@ export class SavedFeedsModel {
|
|||
}
|
||||
}
|
||||
|
||||
// early exit if no feeds need to be fetched
|
||||
if (!neededFeedUris.length || neededFeedUris.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
// fetch the missing models
|
||||
try {
|
||||
for (let i = 0; i < neededFeedUris.length; i += 25) {
|
||||
const res = await this.rootStore.agent.app.bsky.feed.getFeedGenerators({
|
||||
feeds: neededFeedUris.slice(i, 25),
|
||||
|
@ -90,6 +96,10 @@ export class SavedFeedsModel {
|
|||
)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch feed models', error)
|
||||
this.rootStore.log.error('Failed to fetch feed models', error)
|
||||
}
|
||||
|
||||
// merge into the cache
|
||||
runInAction(() => {
|
||||
|
|
Loading…
Reference in New Issue