Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentWillReceiveProps(nextProps) {
if(this.props.saveCompleted != nextProps.saveCompleted
&& nextProps.saveCompleted) {
// Show toast
toastr.success('Author saved.');
// using hashHistory, TODO: proper configure browserHistory on app and here
hashHistory.push('/members')
// Reset saveCompleted flag
this.props.resetSaveCompletedFlag();
}
}
private showToastr(nextProps: Props) {
toastr.clear();
if (nextProps.quizResult.succeeded) {
toastr.success('Test passed');
} else {
toastr.error(nextProps.quizResult.errorMessage);
}
}
activate()
{
toastr.success('tets')
}
private handleAuth(authenticationResult: AuthenticationResult): void {
window.localStorage.setItem(LOCALSTORAGE_AUTH, JSON.stringify(authenticationResult));
success("successfully logged in!");
this.store.dispatch(new SetAuthentication(authenticationResult));
}
}
private async updateGroup(viewModel: GroupViewModel) {
await this.props.updateGroup(viewModel);
toastr.success(strings.groupPage.updateGroupSuccessMessage);
}
export const toastSuccess = (body, header = 'Success', option = toastrOption.success) => {
toastr.success(body, header, option);
};
var write;
switch (toastType) {
case "debug": write = $log.debug; break;
case "error": write = $log.error; break;
case "info": write = $log.info; break;
case "success": write = $log.log; break;
case "warning": write = $log.warn; break;
}
write(currentDateTime, message, data);
var toast = null;
if (showToast) {
switch (toastType) {
case "debug": toast = toastr.info(message, title, optionsOverride); break;
case "error": toast = toastr.error(message, title, optionsOverride); break;
case "info": toast = toastr.info(message, title, optionsOverride); break;
case "success": toast = toastr.success(message, title, optionsOverride); break;
case "warning": toast = toastr.warning(message, title, optionsOverride); break;
}
}
return toast;
}
}