Various release fixes (#1470)
* Fix error state for recommended feeds * Handle failure to set default feeds more safely * Dont return undefined within react-query * Update yarn.lockzio/stable
parent
157daad605
commit
255beb0c1f
|
@ -151,8 +151,7 @@
|
|||
"zod": "^3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@atproto/dev-env": "^0.2.3",
|
||||
"@atproto/pds": "^0.2.0-beta.2",
|
||||
"@atproto/dev-env": "^0.2.5",
|
||||
"@babel/core": "^7.20.0",
|
||||
"@babel/preset-env": "^7.20.0",
|
||||
"@babel/runtime": "^7.20.0",
|
||||
|
|
|
@ -233,18 +233,22 @@ export class PreferencesModel {
|
|||
|
||||
// set defaults on missing items
|
||||
if (typeof prefs.feeds.saved === 'undefined') {
|
||||
const {saved, pinned} = await DEFAULT_FEEDS(
|
||||
this.rootStore.agent.service.toString(),
|
||||
(handle: string) =>
|
||||
this.rootStore.agent
|
||||
.resolveHandle({handle})
|
||||
.then(({data}) => data.did),
|
||||
)
|
||||
runInAction(() => {
|
||||
this.savedFeeds = saved
|
||||
this.pinnedFeeds = pinned
|
||||
})
|
||||
await this.rootStore.agent.setSavedFeeds(saved, pinned)
|
||||
try {
|
||||
const {saved, pinned} = await DEFAULT_FEEDS(
|
||||
this.rootStore.agent.service.toString(),
|
||||
(handle: string) =>
|
||||
this.rootStore.agent
|
||||
.resolveHandle({handle})
|
||||
.then(({data}) => data.did),
|
||||
)
|
||||
runInAction(() => {
|
||||
this.savedFeeds = saved
|
||||
this.pinnedFeeds = pinned
|
||||
})
|
||||
await this.rootStore.agent.setSavedFeeds(saved, pinned)
|
||||
} catch (error) {
|
||||
this.rootStore.log.error('Failed to set default feeds', {error})
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
this.lock.release()
|
||||
|
|
|
@ -34,13 +34,15 @@ export const RecommendedFeeds = observer(function RecommendedFeedsImpl({
|
|||
success,
|
||||
} = await store.agent.app.bsky.feed.getSuggestedFeeds()
|
||||
|
||||
if (!success) return
|
||||
if (!success) {
|
||||
return []
|
||||
}
|
||||
|
||||
return (feeds.length ? feeds : []).map(feed => {
|
||||
return new CustomFeedModel(store, feed)
|
||||
})
|
||||
} catch (e) {
|
||||
return
|
||||
return []
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -148,11 +150,13 @@ export const RecommendedFeeds = observer(function RecommendedFeedsImpl({
|
|||
style={{flex: 1}}
|
||||
/>
|
||||
) : isLoading ? (
|
||||
<View>
|
||||
<View style={{flex: 1}}>
|
||||
<ActivityIndicator size="large" />
|
||||
</View>
|
||||
) : (
|
||||
<ErrorMessage message="Failed to load recommended feeds" />
|
||||
<View style={{flex: 1}}>
|
||||
<ErrorMessage message="Failed to load recommended feeds" />
|
||||
</View>
|
||||
)}
|
||||
|
||||
<Button
|
||||
|
|
Loading…
Reference in New Issue