mirror of
https://github.com/discourse/discourse.git
synced 2026-08-10 04:58:31 -05:00
DEV: Remove decorateCookedElement id parameters (#23544)
These are no longer required per https://github.com/discourse/discourse/pull/23543
This commit is contained in:
@@ -120,34 +120,31 @@ export default {
|
||||
|
||||
// we want to decorate the chat quote dates regardless
|
||||
// of whether the current user has chat enabled
|
||||
api.decorateCookedElement(
|
||||
(elem) => {
|
||||
const currentUser = getOwner(this).lookup("service:current-user");
|
||||
const currentUserTimezone = currentUser?.user_option?.timezone;
|
||||
const chatTranscriptElements =
|
||||
elem.querySelectorAll(".chat-transcript");
|
||||
api.decorateCookedElement((elem) => {
|
||||
const currentUser = getOwner(this).lookup("service:current-user");
|
||||
const currentUserTimezone = currentUser?.user_option?.timezone;
|
||||
const chatTranscriptElements =
|
||||
elem.querySelectorAll(".chat-transcript");
|
||||
|
||||
chatTranscriptElements.forEach((el) => {
|
||||
const dateTimeRaw = el.dataset["datetime"];
|
||||
const dateTimeEl = el.querySelector(
|
||||
".chat-transcript-datetime a, .chat-transcript-datetime span"
|
||||
chatTranscriptElements.forEach((el) => {
|
||||
const dateTimeRaw = el.dataset["datetime"];
|
||||
const dateTimeEl = el.querySelector(
|
||||
".chat-transcript-datetime a, .chat-transcript-datetime span"
|
||||
);
|
||||
|
||||
if (currentUserTimezone) {
|
||||
dateTimeEl.innerText = moment
|
||||
.tz(dateTimeRaw, currentUserTimezone)
|
||||
.format(I18n.t("dates.long_no_year"));
|
||||
} else {
|
||||
dateTimeEl.innerText = moment(dateTimeRaw).format(
|
||||
I18n.t("dates.long_no_year")
|
||||
);
|
||||
}
|
||||
|
||||
if (currentUserTimezone) {
|
||||
dateTimeEl.innerText = moment
|
||||
.tz(dateTimeRaw, currentUserTimezone)
|
||||
.format(I18n.t("dates.long_no_year"));
|
||||
} else {
|
||||
dateTimeEl.innerText = moment(dateTimeRaw).format(
|
||||
I18n.t("dates.long_no_year")
|
||||
);
|
||||
}
|
||||
|
||||
dateTimeEl.dataset.dateFormatted = true;
|
||||
});
|
||||
},
|
||||
{ id: "chat-transcript-datetime" }
|
||||
);
|
||||
dateTimeEl.dataset.dateFormatted = true;
|
||||
});
|
||||
});
|
||||
|
||||
if (!this.chatService.userCanChat) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user