Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
callback: content => {
Toast.hide();
if (content) {
chapter.content = content;
chapterList.find(item => item.id === chapter.id).content = content;
this.setState({
book,
chapter,
chapterList
});
this.scrollToTop();
this.drawer.closeDrawer();
// 自动缓存后5章
this.onCache(5);
} else {
this.setState({
book,
chapter,
componentWillUnmount() {
Storage.set(`scrollTop_${this.bookId}`, { top: scrollTop });
Toast.hide();
}
onSuccess: () => {
Toast.hide()
this.props.dispatch(
NavigationActions.navigate({
routeName: 'Read',
params: { id: book.id },
})
)
},
onError: () => {
callback: () => {
Toast.hide();
dispatch(createAction('book/getBooks')());
dispatch(
NavigationActions.reset({
index: 0,
actions: [NavigationActions.navigate({routeName: 'Home'})],
})
)
},
callbackOne: (data) => {
onSuccess: () => {
Toast.hide();
this.props.dispatch(
NavigationActions.navigate({
routeName: "Read",
params: { id: item.id }
})
);
},
onError: () => {