Merge pull request #405 from mini-bomba/feat/reply-mentions-setting
feat(settings): option to disable reply mentions by default
This commit is contained in:
4 files changed
+21
-3
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Add a setting to disable reply mentions by default
|
||||
@@ -258,6 +258,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
const [enterForNewline] = useSetting(settingsAtom, 'enterForNewline');
|
||||
const [isMarkdown] = useSetting(settingsAtom, 'isMarkdown');
|
||||
const [hideActivity] = useSetting(settingsAtom, 'hideActivity');
|
||||
const [mentionInReplies] = useSetting(settingsAtom, 'mentionInReplies');
|
||||
const commands = useCommands(mx, room);
|
||||
const emojiBtnRef = useRef<HTMLButtonElement>(null);
|
||||
const micBtnRef = useRef<HTMLButtonElement>(null);
|
||||
@@ -363,7 +364,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
);
|
||||
const [scheduleMenuAnchor, setScheduleMenuAnchor] = useState<RectCords>();
|
||||
const [showSchedulePicker, setShowSchedulePicker] = useState(false);
|
||||
const [silentReply, setSilentReply] = useState(false);
|
||||
const [silentReply, setSilentReply] = useState(!mentionInReplies);
|
||||
const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock');
|
||||
const isEncrypted = room.hasEncryptionStateEvent();
|
||||
|
||||
@@ -449,9 +450,9 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
|
||||
useEffect(() => {
|
||||
if (replyDraft !== undefined) {
|
||||
setSilentReply(replyDraft.userId === mx.getUserId());
|
||||
setSilentReply(replyDraft.userId === mx.getUserId() || !mentionInReplies);
|
||||
}
|
||||
}, [mx, replyDraft]);
|
||||
}, [mentionInReplies, mx, replyDraft]);
|
||||
|
||||
const handleFileMetadata = useCallback(
|
||||
(fileItem: TUploadItem, metadata: TUploadMetadata) => {
|
||||
|
||||
@@ -421,6 +421,7 @@ function Editor({ isMobile }: Readonly<{ isMobile: boolean }>) {
|
||||
const [hideActivity, setHideActivity] = useSetting(settingsAtom, 'hideActivity');
|
||||
const [hideReads, setHideReads] = useSetting(settingsAtom, 'hideReads');
|
||||
const [sendPresence, setSendPresence] = useSetting(settingsAtom, 'sendPresence');
|
||||
const [mentionInReplies, setMentionInReplies] = useSetting(settingsAtom, 'mentionInReplies');
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
@@ -471,6 +472,15 @@ function Editor({ isMobile }: Readonly<{ isMobile: boolean }>) {
|
||||
after={<Switch variant="Primary" value={sendPresence} onChange={setSendPresence} />}
|
||||
/>
|
||||
</SequenceCard>
|
||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||
<SettingTile
|
||||
title="Send notifications for replies"
|
||||
description="Disable to use silent replies by default. You can still toggle reply notifications for each reply."
|
||||
after={
|
||||
<Switch variant="Primary" value={mentionInReplies} onChange={setMentionInReplies} />
|
||||
}
|
||||
/>
|
||||
</SequenceCard>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ export interface Settings {
|
||||
alwaysShowCallButton: boolean;
|
||||
faviconForMentionsOnly: boolean;
|
||||
highlightMentions: boolean;
|
||||
mentionInReplies: boolean;
|
||||
|
||||
// furry stuff
|
||||
renderAnimals: boolean;
|
||||
@@ -182,6 +183,7 @@ const defaultSettings: Settings = {
|
||||
alwaysShowCallButton: false,
|
||||
faviconForMentionsOnly: false,
|
||||
highlightMentions: true,
|
||||
mentionInReplies: true,
|
||||
|
||||
// furry stuff
|
||||
renderAnimals: true,
|
||||
|
||||
Reference in new issue
Block a user