mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Use persisted state instead of preferences data for library layout
These visual settings should be per device not set in preferences having them in preferences requires an API call and will make them flicker when loaded.
This commit is contained in:
parent
a0168adc3c
commit
df17496c69
1 changed files with 1 additions and 3 deletions
|
|
@ -502,9 +502,7 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
|
|||
|
||||
const { preferencesData, isValidating: isValidatingPreferences } =
|
||||
useGetUserPreferences()
|
||||
const [layout, setLayout] = useState<LayoutType>(
|
||||
(preferencesData?.libraryLayoutType as LayoutType) || 'GRID_LAYOUT'
|
||||
)
|
||||
const [layout, setLayout] = usePersistedState({ key: 'libraryLayout', initialValue: 'GRID_LAYOUT' })
|
||||
const [showRemoveLinkConfirmation, setShowRemoveLinkConfirmation] =
|
||||
useState(false)
|
||||
const [linkToRemove, setLinkToRemove] = useState<LibraryItem>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue