From fd1b45900dfa7a51d3bfbeadb4cc48605083ee4c Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 28 Sep 2023 15:45:38 +0800 Subject: [PATCH] Different copy for toast when replying or editing --- src/components/compose.jsx | 2 ++ src/components/modals.jsx | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 5fd287e7..bd360bf1 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -839,6 +839,8 @@ function Compose({ // Close onClose({ + // type: post, reply, edit + type: editStatus ? 'edit' : replyToStatus ? 'reply' : 'post', newStatus, instance, }); diff --git a/src/components/modals.jsx b/src/components/modals.jsx index 47c5871c..bab9952c 100644 --- a/src/components/modals.jsx +++ b/src/components/modals.jsx @@ -50,13 +50,17 @@ export default function Modals() { null } onClose={(results) => { - const { newStatus, instance } = results || {}; + const { newStatus, instance, type } = results || {}; states.showCompose = false; window.__COMPOSE__ = null; if (newStatus) { states.reloadStatusPage++; showToast({ - text: 'Post published. Check it out.', + text: { + post: 'Post published. Check it out.', + reply: 'Reply posted. Check it out.', + edit: 'Post updated. Check it out.', + }[type || 'post'], delay: 1000, duration: 10_000, // 10 seconds onClick: (toast) => {