From 02c464a139bf457f7272f640019ed47c2dd836af Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 28 Dec 2022 18:05:22 +0800 Subject: [PATCH] Delay showing "status posted" toast --- src/app.jsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app.jsx b/src/app.jsx index cfe88e54..adf5578f 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -384,18 +384,20 @@ export function App() { states.showCompose = false; if (newStatus) { states.reloadStatusPage++; - const toast = Toastify({ - text: 'Status posted. Check it out.', - duration: 10_000, // 10 seconds - gravity: 'bottom', - position: 'center', - // destination: `/#/s/${newStatus.id}`, - onClick: () => { - toast.hideToast(); - route(`/s/${newStatus.id}`); - }, - }); - toast.showToast(); + setTimeout(() => { + const toast = Toastify({ + text: 'Status posted. Check it out.', + duration: 10_000, // 10 seconds + gravity: 'bottom', + position: 'center', + // destination: `/#/s/${newStatus.id}`, + onClick: () => { + toast.hideToast(); + route(`/s/${newStatus.id}`); + }, + }); + toast.showToast(); + }, 1000); } }} />