Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(dashboard): fix two comments in the chat code

Yudhi Armyndharisa5c780254127
diff --git a/dashboard/src/components/chats/GroupInfoDialog.tsx b/dashboard/src/components/chats/GroupInfoDialog.tsx
index ed13d651a..8c9224eda 100644
--- a/dashboard/src/components/chats/GroupInfoDialog.tsx
+++ b/dashboard/src/components/chats/GroupInfoDialog.tsx
@@ -112,8 +112,8 @@ function GroupInfoDialog({ session, group, onClose, onRenamed }: GroupInfoDialog
const descriptionChanged = Boolean(info) && description !== (info?.description ?? '');
const dirty = nameChanged || descriptionChanged || Boolean(newPicture);
- // Each field is its own route, so each is saved on its own: a picture the engine refuses does not take
- // a saved name down with it, and the toast names the step that failed.
+ // Each field is its own route, called in turn: name, description, picture. Those before a refusal stay saved,
+ // those after it are not tried, and the toast carries the gateway's text for the refusal.
const save = async () => {
if (!info || !dirty || !trimmedName || saving) return;
setSaving(true);
diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsx
index f62e698ef..45da02330 100644
--- a/dashboard/src/pages/Chats.tsx
+++ b/dashboard/src/pages/Chats.tsx
@@ -131,30 +131,6 @@ interface IncomingWsMessage {
// system face); 3–5 are legacy slots older clients still emit. Approximated with generic
// families/weights since the actual faces are proprietary; slot 0 and unknown slots keep the UI
// default.
-// The confirmation dialog's copy for each destructive chat row action; its confirm button repeats the title.
-const CONFIRM_TEXT = {
- leave: {
- title: 'chats.group.leave',
- question: 'chats.group.leaveConfirm',
- warning: 'chats.group.leaveWarning',
- },
- clear: {
- title: 'chats.rowActions.clear',
- question: 'chats.rowActions.clearConfirm',
- warning: 'chats.rowActions.clearWarning',
- },
- block: {
- title: 'chats.rowActions.block',
- question: 'chats.rowActions.blockConfirm',
- warning: 'chats.rowActions.blockWarning',
- },
- delete: {
- title: 'chats.rowActions.delete',
- question: 'chats.rowActions.deleteConfirm',
- warning: 'chats.rowActions.deleteWarning',
- },
-} as const;
-
const STATUS_FONT: Record<number, { family?: string; weight?: number }> = {
1: { family: 'serif' },
2: { family: 'cursive' },
@@ -179,6 +155,30 @@ const statusFontStyle = (font?: number): { fontFamily?: string; fontWeight?: num
};
};
+// The confirmation dialog's copy for each destructive chat row action; its confirm button repeats the title.
+const CONFIRM_TEXT = {
+ leave: {
+ title: 'chats.group.leave',
+ question: 'chats.group.leaveConfirm',
+ warning: 'chats.group.leaveWarning',
+ },
+ clear: {
+ title: 'chats.rowActions.clear',
+ question: 'chats.rowActions.clearConfirm',
+ warning: 'chats.rowActions.clearWarning',
+ },
+ block: {
+ title: 'chats.rowActions.block',
+ question: 'chats.rowActions.blockConfirm',
+ warning: 'chats.rowActions.blockWarning',
+ },
+ delete: {
+ title: 'chats.rowActions.delete',
+ question: 'chats.rowActions.deleteConfirm',
+ warning: 'chats.rowActions.deleteWarning',
+ },
+} as const;
+
export function Chats() {
const { t } = useTranslation();
useDocumentTitle(t('nav.chats'));