Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ scroll to bottom fab new messages counter #535

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/assets/styles/generic/_vuetify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ html {
/**
* Remove icon spacer
*/
.v-list-item__prepend > .v-icon ~ .v-list-item__spacer {
.v-list-item__prepend > .v-icon ~ .v-list-item__spacer,
.v-list-item__prepend > .v-badge ~ .v-list-item__spacer {
width: 0;
}

Expand Down
29 changes: 19 additions & 10 deletions src/components/Chat/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,26 @@
</template>

<template #fab>
<v-btn
<v-badge
:modelValue="numOfNewMessages > 0"
floating
location="top center"
v-if="!isScrolledToBottom"
class="ma-0 grey--text"
color="grey lighten-3"
depressed
fab
size="small"
@click="$refs.chat.scrollToBottom()"
color="primary"
:content="numOfNewMessages > 0 ? numOfNewMessages : undefined"
>
<v-icon icon="mdi-chevron-down" size="x-large" />
</v-btn>
<v-btn
class="ma-0 grey--text"
color="grey lighten-3"
icon
depressed
fab
size="small"
@click="$refs.chat.scrollToBottom()"
>
<v-icon icon="mdi-chevron-down" size="x-large" />
</v-btn>
</v-badge>
</template>
</a-chat>

Expand Down Expand Up @@ -433,7 +442,7 @@ export default {
this.$refs.chat.scrollToBottom()
}

if (!Visibility.hidden()) this.markAsRead()
if (!Visibility.hidden() && this.isScrolledToBottom) this.markAsRead()
})
},
// watch `isFulfilled` when opening chat directly from address bar
Expand Down
Loading