1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 08:53:14 +00:00

[shared with me] mobile: improvement (#3861)

This commit is contained in:
llj
2019-07-17 17:37:39 +08:00
committed by Daniel Pan
parent 694900e82b
commit cfc5f71417
5 changed files with 95 additions and 48 deletions

View File

@@ -110,11 +110,14 @@ class MylibRepoListItem extends React.Component {
}
onStarRepo = () => {
const repoName = this.props.repo.repo_name;
if (this.state.isStarred) {
seafileAPI.unstarItem(this.props.repo.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred});
if (window.innerWidth < 728) {
toaster.success(gettext('Successfully unstarred the library.'));
if (window.innerWidth < 768) {
const msg = gettext('Successfully unstarred {library_name_placeholder}.')
.replace('{library_name_placeholder}', repoName);
toaster.success(msg);
}
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
@@ -123,8 +126,10 @@ class MylibRepoListItem extends React.Component {
} else {
seafileAPI.starItem(this.props.repo.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred});
if (window.innerWidth < 728) {
toaster.success(gettext('Successfully starred the library.'));
if (window.innerWidth < 768) {
const msg = gettext('Successfully starred {library_name_placeholder}.')
.replace('{library_name_placeholder}', repoName);
toaster.success(msg);
}
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);