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

Prop type check repair (#2919)

* repair intent check wraning

* change doublequote to singlequote, add semicolon

* optimized code

* modify type-check wraning
This commit is contained in:
杨顺强
2019-01-31 17:37:02 +08:00
committed by Daniel Pan
parent 06f25f05f2
commit e57701fa38
74 changed files with 714 additions and 700 deletions

View File

@@ -19,19 +19,19 @@ const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
export default class ToastManager extends React.PureComponent {
static propTypes = {
/**
* Function called with the `this.notify` function.
*/
/**
* Function called with the `this.notify` function.
*/
bindNotify: PropTypes.func.isRequired,
/**
* Function called with the `this.getToasts` function.
*/
/**
* Function called with the `this.getToasts` function.
*/
bindGetToasts: PropTypes.func.isRequired,
/**
* Function called with the `this.closeAll` function.
*/
/**
* Function called with the `this.closeAll` function.
*/
bindCloseAll: PropTypes.func.isRequired
}
@@ -58,10 +58,10 @@ export default class ToastManager extends React.PureComponent {
}
notify = (title, settings) => {
// If there's a custom toast ID passed, close existing toasts with the same custom ID
// If there's a custom toast ID passed, close existing toasts with the same custom ID
if (hasCustomId(settings)) {
for (const toast of this.state.toasts) {
// Since unique ID is still appended to a custom ID, skip the unique ID and check only prefix
// Since unique ID is still appended to a custom ID, skip the unique ID and check only prefix
if (String(toast.id).startsWith(settings.id)) {
this.closeToast(toast.id);
}
@@ -94,10 +94,10 @@ export default class ToastManager extends React.PureComponent {
};
}
/**
* This will set isShown on the Toast which will close the toast.
* It won't remove the toast until onExited triggers onRemove.
*/
/**
* This will set isShown on the Toast which will close the toast.
* It won't remove the toast until onExited triggers onRemove.
*/
closeToast = id => {
this.setState(previousState => {
return {