Make library view mode [Downloads|Purchases] persistent.
Previously, the mode kept going back to 'Purchases' on every entry.
This commit is contained in:
parent
bda2bdadf8
commit
fa6a432c9d
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React, { useState } from 'react';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import Button from 'component/button';
|
||||
import ClaimList from 'component/claimList';
|
||||
import Paginate from 'component/common/paginate';
|
||||
|
@ -43,7 +44,7 @@ function FileListDownloaded(props: Props) {
|
|||
fetchingMyPurchases,
|
||||
} = props;
|
||||
const loading = fetchingFileList || fetchingMyPurchases;
|
||||
const [viewMode, setViewMode] = React.useState(VIEW_PURCHASES);
|
||||
const [viewMode, setViewMode] = usePersistedState('library-view-mode', VIEW_PURCHASES);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
|
||||
function handleInputChange(e) {
|
||||
|
|
Loading…
Reference in a new issue