Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.conn.onmessage = event => {
console.log('Message received from server : ', event)
if (event.data === 'update') {
toast.dismiss()
toast.warn('Ce Media a été mis à jour')
this.getClient().then(this.setClient)
}
}
setTimeout(() => {
if (error || !ids) {
console.error(error);
toast.warn(liked ? "取消收藏失败" : "曲目收藏失败");
} else {
this.ids = ids;
toast.warn(liked ? "取消收藏成功" : "曲目收藏成功");
}
this.fetchIds = this.fetchIds.filter(i => i !== id);
}, timeout);
};
setTimeout(() => {
if (error || !ids) {
console.error(error);
toast.warn(liked ? "取消收藏失败" : "期刊收藏失败");
} else {
this.ids = ids;
toast.warn(liked ? "取消收藏成功" : "期刊收藏成功");
}
this.fetchIds = this.fetchIds.filter(i => i !== id);
}, timeout);
};
export function warning(msg: string, options: ToastOptions = {}) {
notify.warn(msg, options);
}
autoClose: false
});
this.stopAuthentication();
}
}
}
} else {
if (!this.state.colSetup) {
this.openSetupDrive();
}
if (this.state.advancedOptions && !this.state.colAdvanced) {
this.openAdvancedSettings();
}
toast.warn(`Check for errors before submitting.`, {
autoClose: false
});
}
}
maxSelectFile=(event)=>{
let files = event.target.files
if (files.length > 3) {
const msg = 'Only 3 images can be uploaded at a time'
event.target.value = null
toast.warn(msg)
return false;
}
return true;
}
checkFileSize=(event)=>{
private updateTag = (oldTag: ITag, newTag: ITag) => {
if (oldTag === newTag) {
return;
}
if (!newTag.name.length) {
toast.warn(strings.tags.warnings.emptyName);
return;
}
if (newTag.name !== oldTag.name && this.state.tags.some((t) => t.name === newTag.name)) {
toast.warn(strings.tags.warnings.existingName);
return;
}
const tags = this.state.tags.map((t) => {
return (t.name === oldTag.name) ? newTag : t;
});
this.setState({
tags,
editingTag: null,
selectedTag: newTag,
}, () => {
this.props.onChange(tags);
});
}
const notifyAll = () => {
toast.success(
<span>
Wow so easy!
</span>
);
toast.success('Wow so easy!');
toast.warn('Please check again!');
toast.error('Something went terribly wrong!');
};
return (
) => {
const messageToShow = message ? titleWithMessage(title, message) : titleWithoutMessage(title)
let toastToShow
switch (type) {
case 'error':
toast.error(messageToShow)
break
case 'info':
toast.info(messageToShow)
break
case 'success':
toast.success(messageToShow)
break
case 'warning':
toast.warn(messageToShow)
break
default:
toast.error(messageToShow)
}
return toastToShow
}