Merge branch '101-start-a-direct-chat-with-a-person-via-their-avatar-profile' into 'dev'

Add "invitations" notification to top of screen

See merge request keanuapp/keanuapp-weblite!69
This commit is contained in:
N Pex 2022-04-13 09:02:51 +00:00
commit 98848e210e
3 changed files with 19 additions and 0 deletions

View file

@ -115,6 +115,11 @@ $admin-fg: white;
background-color: $chat-background; background-color: $chat-background;
overflow: hidden; overflow: hidden;
.chat-room-invitations {
padding: 10px;
background-color: #f2f2f2;
}
.chat-content { .chat-content {
margin: 0; margin: 0;
padding-top: $chat-standard-padding-s; padding-top: $chat-standard-padding-s;

View file

@ -65,6 +65,7 @@
"reply_video": "Video" "reply_video": "Video"
}, },
"room": { "room": {
"invitations": "You have no invitations | You have 1 invitation | You have {count} invitations",
"members": "no members | 1 member | {count} members", "members": "no members | 1 member | {count} members",
"leave": "Leave", "leave": "Leave",
"purge_set_room_state": "Setting room state", "purge_set_room_state": "Setting room state",

View file

@ -1,5 +1,8 @@
<template> <template>
<div class="chat-root fill-height d-flex flex-column"> <div class="chat-root fill-height d-flex flex-column">
<div class="chat-room-invitations clickable" v-if="invitationCount > 0" @click.stop="onInvitationsClick">
{{ $tc("room.invitations", invitationCount)}}
</div>
<ChatHeader <ChatHeader
class="chat-header flex-grow-0 flex-shrink-0" class="chat-header flex-grow-0 flex-shrink-0"
v-on:header-click="onHeaderClick" v-on:header-click="onHeaderClick"
@ -760,6 +763,9 @@ export default {
debugging() { debugging() {
return (window.location.host || "").startsWith("localhost"); return (window.location.host || "").startsWith("localhost");
}, },
invitationCount() {
return this.$matrix.invites.length;
}
}, },
watch: { watch: {
@ -1607,6 +1613,7 @@ export default {
}, },
startPrivateChat(e) { startPrivateChat(e) {
this.loading = true;
this.$matrix this.$matrix
.getOrCreatePrivateChat(e.event.getSender()) .getOrCreatePrivateChat(e.event.getSender())
.then((room) => { .then((room) => {
@ -1626,6 +1633,9 @@ export default {
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
})
.finally(() => {
this.loading = false;
}); });
}, },
@ -1797,6 +1807,9 @@ export default {
} }
this.$refs.roomInfoSheet.open(); this.$refs.roomInfoSheet.open();
}, },
onInvitationsClick() {
this.$navigation.push({ name: "Home" }, -1);
}
}, },
}; };
</script> </script>