Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (ipfsHash) {
// Failed - unpin it from ipfs.menlo.one
// this.localStorage.rm(ipfsHash)
this.remoteStorage.unpin(ipfsHash)
}
let msg = e.message
let timeout = 4000
if (e.message === "Error: MetaMask Tx Signature: User denied transaction signature.") {
msg = "You cancelled the MetaMask transaction."
timeout = 1500
}
console.error(e)
toast(msg, {
autoClose: timeout,
toastId: 123
})
throw e
}
}
}
renderAccountStatus() {
// console.log( 'STATUS: ', this.props.acct.model.status )
if (true) {
toast('This dApp is not connected to a Content Node. To launch your own Content Node, please visit menlo.one for more info.', {
className: 'toast-red-bk',
type: toast.TYPE.ERROR,
toastId: ToastType.Account,
autoClose: false
})
return (
<ul>
<li>
<span>Not connected to Content Node. <a title="Launch a Content Node" href="https://www.menlo.one/docs/">Launch a Content Node</a></span>
</li>
</ul>
)
}
if (this.props.acct.model.status === MetamaskStatus.LoggedOut) {
function login(success) {
// prompt success toast if login was successfull
if (success) {
toast('Login Successfull! Redirecting...', {
position: toast.POSITION.BOTTOM_CENTER,
className: 'toast-success',
progressClassName: 'success-progress-bar',
autoClose: 2000,
toastId: 1
});
}
// propmt error toast if login failes
else {
toast('Invalid e-mail or password. Please try again', {
position: toast.POSITION.BOTTOM_CENTER,
className: 'toast-error',
progressClassName: 'error-progress-bar',
toastId: 2
});
sendNotification: props => (componentProps, options) => {
return toast(
,
options
);
}
}),
notifySave = () => toast('auto saved!', { containerId: 'S' });
notifyDelete = () => toast('code deleted!', { containerId: 'D' });
if (playerId === userId) {
message = `You moved to ${locationName} - ${location}`;
} else {
message = `${playerMap[playerId]} moved to ${locationName} - ${location}`;
}
break;
case LOGTYPE.SMUGGLER_MOVE:
message = `Smugger moved to ${locationName} - ${location}`;
break;
default:
message = '';
break;
}
if ( message && message.trim() !== '') {
toast(message, { type: toast.TYPE.INFO });
}
};
this.gameLogRef.on('child_added', this.gameLogEventHandler);
componentDidMount() {
toast("Default Notification !");
toast.success("Success Notification !", {
position: toast.POSITION.TOP_CENTER
});
toast.error("Error Notification !", {
position: toast.POSITION.TOP_LEFT
});
toast.warn("Warning Notification !", {
position: toast.POSITION.BOTTOM_LEFT
});
toast.info("Info Notification !", {
position: toast.POSITION.BOTTOM_CENTER
});
toast("Custom Style Notification !", {
position: toast.POSITION.BOTTOM_RIGHT,
className: 'dark-toast',
progressClassName: 'transparent-progress'
return updatePost(params).then(result => {
const {data} = result
if (data) {
toast("文章更新成功")
sucCb();
}
});
},
notify = () => {
toast("ZoomIn and ZoomOut", {
autoClose: 5000,
transition: Trans
});
};
handleEnter = (e) => {
if (e.key === 'Enter') {
e.preventDefault();
toast("Press the Search Button", {className: 'popup'});
}
};