Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch((err) => {
this.setState({
saved: false,
error: true,
errorMessage: err.message
});
toastr.error('Error', err); // eslint-disable-line no-console
})
.then(() => this.setState({ loading: false }));
watchGame(event, game) {
event.preventDefault();
if(!this.props.username) {
toastr.error('Please login before trying to watch a game');
return;
}
if(game.needsPassword) {
this.props.joinPasswordGame(game, 'Watch');
} else {
this.props.socket.emit('watchgame', game.id);
}
}
watchGame(event, game) {
let t = this.props.t;
event.preventDefault();
if(!this.props.user) {
toastr.error(t('Please login before trying to watch a game'));
return;
}
if(game.needsPassword) {
this.props.joinPasswordGame(game, 'Watch');
} else {
this.props.socket.emit('watchgame', game.id);
}
}
onError: (error) => {
this.setState({ message: `Error loading insights: ${error}`, loading: false });
toastr.error('Error', error);
}
}
onError: (error) => {
this.setState({ loading: false });
toastr.error('Error', error);
}
});
.catch((err) => {
this.setState({ loading: false });
toastr.error('Error', err);
});
}
}).catch((err) => {
this.setState({ loading: false });
toastr.error('Error', err);
});
}
export const fileSourceUpdateError = error => {
toastr.error('error Saving File', `${error}`);
return {
type: editor.FILESOURCE_UPDATEERROR,
payload: { isFetching: false }
};
};
checkChatError(props) {
if(props.lobbyError) {
toastr.error('New users are limited from chatting in the lobby, try again later');
setTimeout(() => {
this.props.clearChatStatus();
}, 5000);
}
}
onAddCollection = () => {
const { addCollection } = this.props;
const { newCollectionName } = this.state;
if ((newCollectionName || '').toLowerCase() === 'favourites') {
toastr.error('Duplicated Favourites list', 'You cannot duplicate this list.');
return;
}
addCollection({ collectionName: newCollectionName });
}