1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-24 17:49:44 +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

@ -19,7 +19,7 @@ const propTypes = {
toggleStar: PropTypes.func.isRequired,
unmarkDraft: PropTypes.func.isRequired,
onNewNotification: PropTypes.func.isRequired,
onNotificationCleared: PropTypes.func.isRequired
onClearNotification: PropTypes.func.isRequired
};
class ExternalOperations extends React.Component {
@ -44,7 +44,7 @@ class ExternalOperations extends React.Component {
this.unsubscribeFreezeDocument = eventBus.subscribe(EXTERNAL_EVENT.FREEZE_DOCUMENT, this.onFreezeDocument);
this.unsubscribeUnfreeze = eventBus.subscribe(EXTERNAL_EVENT.UNFREEZE, this.unFreeze);
this.unsubscribeNewNotification = eventBus.subscribe(EXTERNAL_EVENT.NEW_NOTIFICATION, this.onNewNotification);
this.unsubscribeClearNotification = eventBus.subscribe(EXTERNAL_EVENT.CLEAR_NOTIFICATION, this.onNotificationCleared);
this.unsubscribeClearNotification = eventBus.subscribe(EXTERNAL_EVENT.CLEAR_NOTIFICATION, this.onClearNotification);
this.unsubscribeCreateSdocFile = eventBus.subscribe(EXTERNAL_EVENT.CREATE_SDOC_FILE, this.onCreateSdocFile);
}
@ -126,8 +126,8 @@ class ExternalOperations extends React.Component {
this.props.onNewNotification();
};
onNotificationCleared = () => {
this.props.onNotificationCleared();
onClearNotification = () => {
this.props.onClearNotification();
};
onCreateSdocFile = (params) => {

View File

@ -43,7 +43,7 @@ export default class SdocEditor extends React.Component {
this.onSetFavicon('_notification');
};
onNotificationCleared = () => {
onClearNotification = () => {
this.onSetFavicon();
};
@ -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>
);