Files
Jarek RadoszandGitHub 88a7c980cf DEV: Minor refactor of chat models (#27467)
* remove default prop values where they're being set in constructor
* replace some `||` operators in constructors with `??` so the fallback boolean values are actually used
2024-06-13 17:07:31 +02:00

26 lines
713 B
JavaScript

import { tracked } from "@glimmer/tracking";
import { NotificationLevels } from "discourse/lib/notification-levels";
export default class UserChatThreadMembership {
static create(args = {}) {
return new UserChatThreadMembership(args);
}
@tracked lastReadMessageId;
@tracked notificationLevel;
@tracked threadTitlePromptSeen;
constructor(args = {}) {
this.lastReadMessageId = args.last_read_message_id;
this.notificationLevel = args.notification_level;
this.threadTitlePromptSeen = args.thread_title_prompt_seen;
}
get isQuiet() {
return (
this.notificationLevel === NotificationLevels.REGULAR ||
this.notificationLevel === NotificationLevels.MUTED
);
}
}