1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 19:29:56 +00:00

fix: optimize code

This commit is contained in:
liuhongbo
2024-03-01 18:15:01 +08:00
parent fb17628cc8
commit d6142e0432
2 changed files with 15 additions and 15 deletions

View File

@@ -23,11 +23,11 @@ export default class SdocEditor extends React.Component {
}
toggleStar = (isStarred) => {
this.setState({isStarred: isStarred});
this.setState({ isStarred: isStarred });
};
unmarkDraft = () => {
this.setState({isDraft: false});
this.setState({ isDraft: false });
};
onSetFavicon = (suffix) => {
@@ -43,7 +43,7 @@ export default class SdocEditor extends React.Component {
this.onSetFavicon('_notification');
};
onNotificationCleared = () => {
onClearNotification = () => {
this.onSetFavicon();
};
@@ -59,7 +59,7 @@ export default class SdocEditor extends React.Component {
getDirentList = () => {
const { repoID } = window.seafile;
const path = this.getDirPath();
seafileAPI.listDir(repoID, path, {'with_thumbnail': true}).then(res => {
seafileAPI.listDir(repoID, path, { 'with_thumbnail': true }).then(res => {
let direntList = [];
res.data.dirent_list.forEach(item => {
let dirent = new Dirent(item);
@@ -91,7 +91,7 @@ export default class SdocEditor extends React.Component {
toggleStar={this.toggleStar}
unmarkDraft={this.unmarkDraft}
onNewNotification={this.onNewNotification}
onNotificationCleared={this.onNotificationCleared}
onClearNotification={this.onClearNotification}
/>
</Fragment>
);