diff --git a/postcss.config.js b/postcss.config.js
index 427baeed..95e263d3 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -6,6 +6,7 @@ const safelistSelectors = [
'body',
'stroke-primary',
'mode-dark',
+ 'line-through',
// Components with custom color prop might need its color to be whitelisted too
'bg-blue-500',
'hover:bg-blue-400'
diff --git a/src/components/Hyperchat.svelte b/src/components/Hyperchat.svelte
index ab89cdb5..cdce88b4 100644
--- a/src/components/Hyperchat.svelte
+++ b/src/components/Hyperchat.svelte
@@ -24,7 +24,7 @@
chatUserActionsItems,
ChatUserActions
} from '../ts/chat-constants';
- import { isAllEmoji, isChatMessage, isPrivileged, responseIsAction } from '../ts/chat-utils';
+ import { buildDeletedObj, isAllEmoji, isChatMessage, isPrivileged, responseIsAction } from '../ts/chat-utils';
import { handleReplyThreadResponse } from '../ts/chat-actions';
import Button from 'smelte/src/components/Button';
import {
@@ -216,14 +216,15 @@
};
const onDelete = (deletion: Ytc.ParsedDeleted) => {
- messageActions.some((action) => {
+ const changed = messageActions.some((action) => {
if (isWelcome(action)) return false;
if (action.message.messageId === deletion.messageId) {
- action.deleted = { replace: deletion.replacedMessage };
+ action.deleted = buildDeletedObj(deletion, action.message.message);
return true;
}
return false;
});
+ if (changed) messageActions = messageActions;
};
const onChatAction = (action: Chat.Actions, isInitial = false) => {
@@ -320,6 +321,14 @@
$ytDark = response.dark;
break;
case 'chatUserActionResponse':
+ if (response.success && response.action === ChatUserActions.DELETE_MESSAGE) {
+ onDelete({
+ messageId: response.message.messageId,
+ replacedMessage: [],
+ pending: true
+ });
+ break;
+ }
$alertDialog = {
title: response.success ? 'Success!' : 'Error',
message: chatUserActionsItems.find(v => v.value === response.action)
@@ -327,13 +336,6 @@
color: response.success ? 'primary' : 'error'
};
if (response.success) {
- if (response.action === ChatUserActions.DELETE_MESSAGE) {
- onDelete({
- messageId: response.message.messageId,
- replacedMessage: [{ text: '[message retracted]' }]
- });
- break;
- }
messageActions = messageActions.filter(
(a) => {
if (isWelcome(a)) return true;
@@ -465,7 +467,7 @@
{#if $enableStickySuperchatBar}