bug fixes and UI improvements

This commit is contained in:
sairaj mote 2022-06-21 00:45:16 +05:30
parent 459edc47a0
commit 13fa11b6e4
4 changed files with 13 additions and 5 deletions

View File

@ -1089,6 +1089,10 @@ sm-button[variant=primary] {
#warn_no_encryption, #warn_no_encryption,
.date-card, .date-card,
.group-event-card { .group-event-card {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1;
padding: 0.4rem 0.6rem; padding: 0.4rem 0.6rem;
font-weight: 500; font-weight: 500;
font-size: 0.8rem; font-size: 0.8rem;

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -976,6 +976,9 @@ sm-button[variant="primary"] {
#warn_no_encryption, #warn_no_encryption,
.date-card, .date-card,
.group-event-card { .group-event-card {
position: sticky;
top: 0;
z-index: 1;
padding: 0.4rem 0.6rem; padding: 0.4rem 0.6rem;
font-weight: 500; font-weight: 500;
font-size: 0.8rem; font-size: 0.8rem;

View File

@ -1507,7 +1507,7 @@
const frag = document.createDocumentFragment(); const frag = document.createDocumentFragment();
if (lazyLoad) { if (lazyLoad) {
if (this.bottomFirst) { if (this.bottomFirst) {
this.updateEndIndex = this.updateStartIndex - 1 this.updateEndIndex = this.updateStartIndex
this.updateStartIndex = this.updateEndIndex - this.batchSize this.updateStartIndex = this.updateEndIndex - this.batchSize
} else { } else {
this.updateStartIndex = this.updateEndIndex this.updateStartIndex = this.updateEndIndex
@ -1526,7 +1526,7 @@
} }
this.lastScrollHeight = this.lazyContainer.scrollHeight this.lastScrollHeight = this.lazyContainer.scrollHeight
this.lastScrollTop = this.lazyContainer.scrollTop this.lastScrollTop = this.lazyContainer.scrollTop
this.arrayOfElements.slice(this.updateStartIndex, this.updateEndIndex).forEach((element) => { this.arrayOfElements.slice(this.updateStartIndex, this.updateEndIndex).forEach((element, index) => {
frag.append(this.renderFn(element)) frag.append(this.renderFn(element))
}) })
if (this.bottomFirst) { if (this.bottomFirst) {
@ -1534,10 +1534,11 @@
} else { } else {
this.lazyContainer.append(frag) this.lazyContainer.append(frag)
} }
if (!lazyLoad && this.bottomFirst) if (!lazyLoad && this.bottomFirst) {
this.lazyContainer.scrollTo({ this.lazyContainer.scrollTo({
top: this.lazyContainer.scrollHeight, top: this.lazyContainer.scrollHeight,
}) })
}
// Callback to be called if elements are updated or rendered for first time // Callback to be called if elements are updated or rendered for first time
if (!lazyLoad && this.freshRender) if (!lazyLoad && this.freshRender)
this.freshRender() this.freshRender()
@ -2650,7 +2651,7 @@
async function renderMessages(options) { async function renderMessages(options) {
let { markUnread = true } = options let { markUnread = true } = options
try { try {
let messages = Object.values(await messenger.getChat(activeChat['floID'])) let messages = Object.values(await messenger.getChat(activeChat.floID))
if (activeChat.floID) { if (activeChat.floID) {
if (chatLazyLoader) { if (chatLazyLoader) {
chatLazyLoader.update(messages) chatLazyLoader.update(messages)