mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Add new chat indicator preference within chat user preferences. Enabling this option will mean that green notifications will only appear for mentions (within channels and DMs. This change also enables mentions within direct messages.
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import Component from "@glimmer/component";
|
|
import { tracked } from "@glimmer/tracking";
|
|
import { action } from "@ember/object";
|
|
import {
|
|
HEADER_INDICATOR_PREFERENCE_ALL_NEW,
|
|
HEADER_INDICATOR_PREFERENCE_DM_AND_MENTIONS,
|
|
HEADER_INDICATOR_PREFERENCE_NEVER,
|
|
HEADER_INDICATOR_PREFERENCE_ONLY_MENTIONS,
|
|
} from "discourse/plugins/chat/discourse/controllers/preferences-chat";
|
|
|
|
export default class ChatStyleguideChatHeaderIcon extends Component {
|
|
@tracked isActive = false;
|
|
@tracked currentUserInDnD = false;
|
|
@tracked urgentCount;
|
|
@tracked unreadCount;
|
|
@tracked indicatorPreference = HEADER_INDICATOR_PREFERENCE_ALL_NEW;
|
|
|
|
get indicatorPreferences() {
|
|
return [
|
|
HEADER_INDICATOR_PREFERENCE_ALL_NEW,
|
|
HEADER_INDICATOR_PREFERENCE_DM_AND_MENTIONS,
|
|
HEADER_INDICATOR_PREFERENCE_ONLY_MENTIONS,
|
|
HEADER_INDICATOR_PREFERENCE_NEVER,
|
|
];
|
|
}
|
|
|
|
@action
|
|
toggleIsActive() {
|
|
this.isActive = !this.isActive;
|
|
}
|
|
|
|
@action
|
|
toggleCurrentUserInDnD() {
|
|
this.currentUserInDnD = !this.currentUserInDnD;
|
|
}
|
|
|
|
@action
|
|
updateUnreadCount(event) {
|
|
this.unreadCount = event.target.value;
|
|
}
|
|
|
|
@action
|
|
updateUrgentCount(event) {
|
|
this.urgentCount = event.target.value;
|
|
}
|
|
|
|
@action
|
|
updateIndicatorPreference(value) {
|
|
this.indicatorPreference = value;
|
|
}
|
|
}
|