1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

record sord type&order (#3133)

This commit is contained in:
杨顺强
2019-03-19 10:35:21 +08:00
committed by Daniel Pan
parent b4f79e6491
commit 413f82b484
5 changed files with 24 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import React,{ Fragment } from 'react';
import { Popover } from 'reactstrap';
import PropTypes from 'prop-types';
import cookie from 'react-cookies';
import { gettext, siteRoot, username, loginUrl, canAddRepo } from '../../utils/constants';
import { Link } from '@reach/router';
import { seafileAPI } from '../../utils/seafile-api';
@@ -42,8 +43,8 @@ class GroupView extends React.Component {
currentRepo: null,
isStaff: false,
isOwner: false,
sortBy: 'name', // 'name' or 'time'
sortOrder: 'asc', // 'asc' or 'desc'
sortBy: cookie.load('seafile-repo-sort-by') || 'name', // 'name' or 'time'
sortOrder: cookie.load('seafile-repo-sort-order') || 'asc', // 'asc' or 'desc'
repoList: [],
libraryType: 'group',
isCreateRepoDialogShow: false,
@@ -330,6 +331,8 @@ class GroupView extends React.Component {
}
sortItems = (sortBy, sortOrder) => {
cookie.save('seafile-repo-sort-by', sortBy);
cookie.save('seafile-repo-sort-order', sortOrder);
this.setState({
sortBy: sortBy,
sortOrder: sortOrder,