mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 22:33:17 +00:00
Fix eslint warnings (#5635)
* 01 fix eslint warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings
This commit is contained in:
@@ -33,7 +33,7 @@ export default class ToastManager extends React.PureComponent {
|
||||
* Function called with the `this.closeAll` function.
|
||||
*/
|
||||
bindCloseAll: PropTypes.func.isRequired
|
||||
}
|
||||
};
|
||||
|
||||
static idCounter = 0;
|
||||
|
||||
@@ -51,11 +51,11 @@ export default class ToastManager extends React.PureComponent {
|
||||
|
||||
getToasts = () => {
|
||||
return this.state.toasts;
|
||||
}
|
||||
};
|
||||
|
||||
closeAll = () => {
|
||||
this.getToasts().forEach(toast => toast.close());
|
||||
}
|
||||
};
|
||||
|
||||
notify = (title, settings) => {
|
||||
// If there's a custom toast ID passed, close existing toasts with the same custom ID
|
||||
@@ -77,7 +77,7 @@ export default class ToastManager extends React.PureComponent {
|
||||
});
|
||||
|
||||
return instance;
|
||||
}
|
||||
};
|
||||
|
||||
createToastInstance = (title, settings) => {
|
||||
const uniqueId = ++ToastManager.idCounter;
|
||||
@@ -92,7 +92,7 @@ export default class ToastManager extends React.PureComponent {
|
||||
close: () => this.closeToast(id),
|
||||
intent: settings.intent
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This will set isShown on the Toast which will close the toast.
|
||||
@@ -112,7 +112,7 @@ export default class ToastManager extends React.PureComponent {
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
removeToast = id => {
|
||||
this.setState(previousState => {
|
||||
@@ -120,7 +120,7 @@ export default class ToastManager extends React.PureComponent {
|
||||
toasts: previousState.toasts.filter(toast => toast.id !== id)
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
@@ -135,4 +135,4 @@ export default class ToastManager extends React.PureComponent {
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user