Different copy for toast when replying or editing

This commit is contained in:
Lim Chee Aun 2023-09-28 15:45:38 +08:00
parent 0f5edef199
commit fd1b45900d
2 changed files with 8 additions and 2 deletions

View file

@ -839,6 +839,8 @@ function Compose({
// Close // Close
onClose({ onClose({
// type: post, reply, edit
type: editStatus ? 'edit' : replyToStatus ? 'reply' : 'post',
newStatus, newStatus,
instance, instance,
}); });

View file

@ -50,13 +50,17 @@ export default function Modals() {
null null
} }
onClose={(results) => { onClose={(results) => {
const { newStatus, instance } = results || {}; const { newStatus, instance, type } = results || {};
states.showCompose = false; states.showCompose = false;
window.__COMPOSE__ = null; window.__COMPOSE__ = null;
if (newStatus) { if (newStatus) {
states.reloadStatusPage++; states.reloadStatusPage++;
showToast({ 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, delay: 1000,
duration: 10_000, // 10 seconds duration: 10_000, // 10 seconds
onClick: (toast) => { onClick: (toast) => {