mirror of
https://github.com/discourse/discourse.git
synced 2025-02-19 20:59:31 +08:00
26 lines
700 B
JavaScript
26 lines
700 B
JavaScript
import discourseComputed from "discourse-common/utils/decorators";
|
|
import Component from "@ember/component";
|
|
import { equal } from "@ember/object/computed";
|
|
import { inject as service } from "@ember/service";
|
|
import { CHATABLE_TYPES } from "discourse/plugins/chat/discourse/models/chat-channel";
|
|
|
|
export default Component.extend({
|
|
tagName: "",
|
|
channel: null,
|
|
chat: service(),
|
|
|
|
isDirectMessageRow: equal(
|
|
"channel.chatable_type",
|
|
CHATABLE_TYPES.directMessageChannel
|
|
),
|
|
|
|
@discourseComputed("isDirectMessageRow")
|
|
leaveChatTitleKey(isDirectMessageRow) {
|
|
if (isDirectMessageRow) {
|
|
return "chat.direct_messages.leave";
|
|
} else {
|
|
return "chat.leave";
|
|
}
|
|
},
|
|
});
|