Improve types (#1921)
parent
d8b26edb56
commit
8857ba70c6
|
@ -31,7 +31,7 @@ export type UsePreferencesQueryResponse = Omit<
|
|||
*/
|
||||
contentLabels: Record<ConfigurableLabelGroup, LabelPreference>
|
||||
feedViewPrefs: BskyFeedViewPreference & {
|
||||
lab_mergeFeedEnabled: boolean
|
||||
lab_mergeFeedEnabled?: boolean
|
||||
}
|
||||
/**
|
||||
* User thread-view prefs, including newer fields that may not be typed yet.
|
||||
|
@ -45,5 +45,5 @@ export type UsePreferencesQueryResponse = Omit<
|
|||
|
||||
export type ThreadViewPreferences = Omit<BskyThreadViewPreference, 'sort'> & {
|
||||
sort: 'oldest' | 'newest' | 'most-likes' | 'random' | string
|
||||
lab_treeViewEnabled: boolean
|
||||
lab_treeViewEnabled?: boolean
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ function PostThreadLoaded({
|
|||
post={item.post}
|
||||
record={item.record}
|
||||
dataUpdatedAt={dataUpdatedAt}
|
||||
treeView={threadViewPrefs.lab_treeViewEnabled}
|
||||
treeView={threadViewPrefs.lab_treeViewEnabled || false}
|
||||
depth={item.ctx.depth}
|
||||
isHighlightedPost={item.ctx.isHighlightedPost}
|
||||
hasMore={item.ctx.hasMore}
|
||||
|
|
|
@ -48,7 +48,9 @@ export const HomeScreen = withAuthRequired(
|
|||
if (!preferences) return {}
|
||||
|
||||
return {
|
||||
mergeFeedEnabled: preferences.feedViewPrefs.lab_mergeFeedEnabled,
|
||||
mergeFeedEnabled: Boolean(
|
||||
preferences.feedViewPrefs.lab_mergeFeedEnabled,
|
||||
),
|
||||
mergeFeedSources: preferences.feeds.saved,
|
||||
}
|
||||
}, [preferences])
|
||||
|
|
Loading…
Reference in New Issue