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
onClose({
// type: post, reply, edit
type: editStatus ? 'edit' : replyToStatus ? 'reply' : 'post',
newStatus,
instance,
});

View file

@ -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) => {