mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
* 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
26 lines
713 B
JavaScript
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
|
|
);
|
|
}
|
|
}
|