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.lock
zio/stable
Paul Frazee 2023-09-18 13:38:33 -07:00 committed by GitHub
parent 157daad605
commit 255beb0c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 195 additions and 1345 deletions

View File

@ -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",

View File

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

View File

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

1497
yarn.lock

File diff suppressed because it is too large Load Diff