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" "zod": "^3.20.2"
}, },
"devDependencies": { "devDependencies": {
"@atproto/dev-env": "^0.2.3", "@atproto/dev-env": "^0.2.5",
"@atproto/pds": "^0.2.0-beta.2",
"@babel/core": "^7.20.0", "@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0", "@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0", "@babel/runtime": "^7.20.0",

View File

@ -233,6 +233,7 @@ export class PreferencesModel {
// set defaults on missing items // set defaults on missing items
if (typeof prefs.feeds.saved === 'undefined') { if (typeof prefs.feeds.saved === 'undefined') {
try {
const {saved, pinned} = await DEFAULT_FEEDS( const {saved, pinned} = await DEFAULT_FEEDS(
this.rootStore.agent.service.toString(), this.rootStore.agent.service.toString(),
(handle: string) => (handle: string) =>
@ -245,6 +246,9 @@ export class PreferencesModel {
this.pinnedFeeds = pinned this.pinnedFeeds = pinned
}) })
await this.rootStore.agent.setSavedFeeds(saved, pinned) await this.rootStore.agent.setSavedFeeds(saved, pinned)
} catch (error) {
this.rootStore.log.error('Failed to set default feeds', {error})
}
} }
} finally { } finally {
this.lock.release() this.lock.release()

View File

@ -34,13 +34,15 @@ export const RecommendedFeeds = observer(function RecommendedFeedsImpl({
success, success,
} = await store.agent.app.bsky.feed.getSuggestedFeeds() } = await store.agent.app.bsky.feed.getSuggestedFeeds()
if (!success) return if (!success) {
return []
}
return (feeds.length ? feeds : []).map(feed => { return (feeds.length ? feeds : []).map(feed => {
return new CustomFeedModel(store, feed) return new CustomFeedModel(store, feed)
}) })
} catch (e) { } catch (e) {
return return []
} }
}, },
}) })
@ -148,11 +150,13 @@ export const RecommendedFeeds = observer(function RecommendedFeedsImpl({
style={{flex: 1}} style={{flex: 1}}
/> />
) : isLoading ? ( ) : isLoading ? (
<View> <View style={{flex: 1}}>
<ActivityIndicator size="large" /> <ActivityIndicator size="large" />
</View> </View>
) : ( ) : (
<View style={{flex: 1}}>
<ErrorMessage message="Failed to load recommended feeds" /> <ErrorMessage message="Failed to load recommended feeds" />
</View>
)} )}
<Button <Button

1497
yarn.lock

File diff suppressed because it is too large Load Diff