Browse Source

Merge branch 'develop' of git.digitaltelepresence.com:digital-telepresence/dtp-base into develop

develop
Rob Colbert 2 years ago
parent
commit
56e3de5f76
  1. 21
      app/views/chat/components/room-list.pug
  2. 19
      app/views/chat/layouts/room.pug
  3. 1
      client/js/site-chat.js
  4. 1
      lib/site-ioserver.js

21
app/views/chat/components/room-list.pug

@ -1,4 +1,17 @@
mixin renderRoomList (rooms)
each room in rooms
li.uk-active
a(href=`/chat/room/${room._id}`)= room.name
mixin renderRoomList (rooms, options)
ul#room-list.uk-nav.uk-nav-default
li.uk-nav-header
div(uk-grid).uk-grid-small
.uk-text-bold.uk-width-expand= options.title
if !options.hideCreate
.uk-width-auto
a(href='/chat/room/create', title= "Create new chat room...").uk-link-reset
i.fas.fa-plus
if Array.isArray(rooms) && (rooms.length > 0)
each room in rooms
li.uk-active
a(href=`/chat/room/${room._id}`)= room.name
else
li= options.emptyPrompt

19
app/views/chat/layouts/room.pug

@ -9,25 +9,10 @@ block content-container
div(uk-grid).uk-height-1-1
div(class="uk-width-1-1 uk-width-1-5@l uk-flex-last uk-flex-first@l").uk-height-1-1.uk-overflow-auto
.site-chat-sidebar-widget.uk-border-rounded.uk-margin
if Array.isArray(ownedChatRooms) && (ownedChatRooms.length > 0)
ul#room-list.uk-nav.uk-nav-default
li.uk-nav-header
div(uk-grid).uk-grid-small
.uk-text-bold.uk-width-expand Your Rooms
.uk-width-auto
a(href='/chat/room/create', title= "Create new chat room...").uk-link-reset
i.fas.fa-plus
+renderRoomList(ownedChatRooms)
else
div You don't own any chat rooms.
+renderRoomList(ownedChatRooms, { title: "Your Rooms", emptyPrompt: "You don't own any chat rooms" })
.site-chat-sidebar-widget.uk-border-rounded
if Array.isArray(joinedChatRooms) && (joinedChatRooms.length > 0)
ul#room-list.uk-nav.uk-nav-default
li.uk-nav-header Joined Rooms
+renderRoomList(joinedChatRooms)
else
div You haven't joined any chat rooms.
+renderRoomList(joinedChatRooms, { title: "Joined Rooms", emptyPrompt: "You haven't joined any chat rooms", hideCreate: true })
div(class="uk-width-1-1 uk-width-expand@l").uk-height-1-1
#chat-room.uk-height-1-1

1
client/js/site-chat.js

@ -247,7 +247,6 @@ export default class SiteChat {
createEmojiReact (message) {
this.ui.reactions.create(message.reaction);
this.triggerEmojiExplosion();
}
triggerEmojiExplosion ( ) {

1
lib/site-ioserver.js

@ -190,7 +190,6 @@ class SiteIoServer extends Events {
const channelId = reaction.subject.toString();
await chatService.sendMessage(channelId, 'user-react', payload);
session.socket.emit('user-react', payload);
} catch (error) {
this.log.error('failed to process reaction', { message, error });
session.socket.emit('system-message', {

Loading…
Cancel
Save