Skip to content

Commit d9103c8

Browse files
committed
Check every tag before defining
1 parent baeb209 commit d9103c8

File tree

5 files changed

+41
-33
lines changed

5 files changed

+41
-33
lines changed

js/chat/chat.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,19 @@ class ChatContainer extends LightElement {
528528

529529
// ------- Register custom elements and shiny bindings ---------
530530

531-
if (!customElements.get(CHAT_MESSAGES_TAG)) {
531+
if (!customElements.get(CHAT_MESSAGE_TAG)) {
532532
customElements.define(CHAT_MESSAGE_TAG, ChatMessage);
533+
}
534+
if (!customElements.get(CHAT_USER_MESSAGE_TAG)) {
533535
customElements.define(CHAT_USER_MESSAGE_TAG, ChatUserMessage);
536+
}
537+
if (!customElements.get(CHAT_MESSAGES_TAG)) {
534538
customElements.define(CHAT_MESSAGES_TAG, ChatMessages);
539+
}
540+
if (!customElements.get(CHAT_INPUT_TAG)) {
535541
customElements.define(CHAT_INPUT_TAG, ChatInput);
542+
}
543+
if (!customElements.get(CHAT_CONTAINER_TAG)) {
536544
customElements.define(CHAT_CONTAINER_TAG, ChatContainer);
537545
}
538546

0 commit comments

Comments
 (0)