Hide toast on click.

pull/744/head
Dessalines 2020-03-21 11:21:15 -04:00
parent ef9ae09c2b
commit 0414edeade
1 changed files with 6 additions and 2 deletions

6
ui/src/utils.ts vendored
View File

@ -444,7 +444,8 @@ export function messageToastify(
router: any router: any
) { ) {
let backgroundColor = `var(--light)`; let backgroundColor = `var(--light)`;
Toastify({
let toast = Toastify({
text: `${body}<br />${creator}`, text: `${body}<br />${creator}`,
avatar: avatar, avatar: avatar,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
@ -453,7 +454,10 @@ export function messageToastify(
position: 'right', position: 'right',
duration: 0, duration: 0,
onClick: () => { onClick: () => {
if (toast) {
toast.hideToast();
router.history.push(link); router.history.push(link);
}
}, },
}).showToast(); }).showToast();
} }