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