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
This commit is contained in:
parent
157daad605
commit
255beb0c1f
4 changed files with 195 additions and 1345 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue