Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,25 @@ const UserOptionsSection: React.FC<{
// Only allow the user to ignore the user if its not ourselves
// same goes for jumping to read receipt
if (!isMe) {
const onIgnoreToggle = () => {
const onIgnoreToggle = async () => {
const ignoredUsers = cli.getIgnoredUsers();
if (isIgnored) {
const index = ignoredUsers.indexOf(member.userId);
if (index !== -1) ignoredUsers.splice(index, 1);
} else {
// ask the user to confirm
const [accepted] = await Modal.createTrackedDialog("Confirm Ignore User", "", QuestionDialog, {
title: _t("Do you want to ignore this user?"),
description: _t(
"You won't see messages from %(targetName)s anymore. Are you sure you want to ignore them?",
{ targetName: member.name },
),
}).finished;
if (!accepted) return;
ignoredUsers.push(member.userId);
}

// noinspection ES6MissingAwait
cli.setIgnoredUsers(ignoredUsers);
};

Expand Down
2 changes: 2 additions & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,8 @@
"%(count)s sessions|one": "%(count)s session",
"Hide sessions": "Hide sessions",
"Message": "Message",
"Do you want to ignore this user?": "Do you want to ignore this user?",
"You won't see messages from %(targetName)s anymore. Are you sure you want to ignore them?": "You won't see messages from %(targetName)s anymore. Are you sure you want to ignore them?",
"Jump to read receipt": "Jump to read receipt",
"Mention": "Mention",
"Share Link to User": "Share Link to User",
Expand Down