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
|
// @flow
|
||||||
import * as ICONS from 'constants/icons';
|
import * as ICONS from 'constants/icons';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import usePersistedState from 'effects/use-persisted-state';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ClaimList from 'component/claimList';
|
import ClaimList from 'component/claimList';
|
||||||
import Paginate from 'component/common/paginate';
|
import Paginate from 'component/common/paginate';
|
||||||
|
@ -43,7 +44,7 @@ function FileListDownloaded(props: Props) {
|
||||||
fetchingMyPurchases,
|
fetchingMyPurchases,
|
||||||
} = props;
|
} = props;
|
||||||
const loading = fetchingFileList || fetchingMyPurchases;
|
const loading = fetchingFileList || fetchingMyPurchases;
|
||||||
const [viewMode, setViewMode] = React.useState(VIEW_PURCHASES);
|
const [viewMode, setViewMode] = usePersistedState('library-view-mode', VIEW_PURCHASES);
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
|
|
||||||
function handleInputChange(e) {
|
function handleInputChange(e) {
|
||||||
|
|
Loading…
Reference in a new issue