mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-25 10:11:24 +00:00
fix: optimize code
This commit is contained in:
parent
fb17628cc8
commit
d6142e0432
@ -19,7 +19,7 @@ const propTypes = {
|
|||||||
toggleStar: PropTypes.func.isRequired,
|
toggleStar: PropTypes.func.isRequired,
|
||||||
unmarkDraft: PropTypes.func.isRequired,
|
unmarkDraft: PropTypes.func.isRequired,
|
||||||
onNewNotification: PropTypes.func.isRequired,
|
onNewNotification: PropTypes.func.isRequired,
|
||||||
onNotificationCleared: PropTypes.func.isRequired
|
onClearNotification: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExternalOperations extends React.Component {
|
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.unsubscribeFreezeDocument = eventBus.subscribe(EXTERNAL_EVENT.FREEZE_DOCUMENT, this.onFreezeDocument);
|
||||||
this.unsubscribeUnfreeze = eventBus.subscribe(EXTERNAL_EVENT.UNFREEZE, this.unFreeze);
|
this.unsubscribeUnfreeze = eventBus.subscribe(EXTERNAL_EVENT.UNFREEZE, this.unFreeze);
|
||||||
this.unsubscribeNewNotification = eventBus.subscribe(EXTERNAL_EVENT.NEW_NOTIFICATION, this.onNewNotification);
|
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);
|
this.unsubscribeCreateSdocFile = eventBus.subscribe(EXTERNAL_EVENT.CREATE_SDOC_FILE, this.onCreateSdocFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,8 +126,8 @@ class ExternalOperations extends React.Component {
|
|||||||
this.props.onNewNotification();
|
this.props.onNewNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
onNotificationCleared = () => {
|
onClearNotification = () => {
|
||||||
this.props.onNotificationCleared();
|
this.props.onClearNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
onCreateSdocFile = (params) => {
|
onCreateSdocFile = (params) => {
|
||||||
|
@ -43,7 +43,7 @@ export default class SdocEditor extends React.Component {
|
|||||||
this.onSetFavicon('_notification');
|
this.onSetFavicon('_notification');
|
||||||
};
|
};
|
||||||
|
|
||||||
onNotificationCleared = () => {
|
onClearNotification = () => {
|
||||||
this.onSetFavicon();
|
this.onSetFavicon();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ export default class SdocEditor extends React.Component {
|
|||||||
toggleStar={this.toggleStar}
|
toggleStar={this.toggleStar}
|
||||||
unmarkDraft={this.unmarkDraft}
|
unmarkDraft={this.unmarkDraft}
|
||||||
onNewNotification={this.onNewNotification}
|
onNewNotification={this.onNewNotification}
|
||||||
onNotificationCleared={this.onNotificationCleared}
|
onClearNotification={this.onClearNotification}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user