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"
|
"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",
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue