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 1ed84b35..580f169d 100644
--- a/src/components/Hyperchat.svelte
+++ b/src/components/Hyperchat.svelte
@@ -22,6 +22,7 @@
ChatUserActions
} from '../ts/chat-constants';
import {
+ buildDeletedObj,
isAllEmoji,
isChatMessage,
isPrivileged,
@@ -249,14 +250,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) => {
@@ -353,6 +355,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)
@@ -360,13 +370,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;
@@ -515,7 +518,7 @@
{#if $enableStickySuperchatBar}