Compare commits

...

2 commits

Author SHA1 Message Date
Kainoa Kanter
6f09e14225
🎨 2022-07-11 15:00:48 -07:00
ThatOneCalculator
8b4be8cad1 Fix broken chats
Co-authored-by: @ltlapy
2022-07-11 13:45:00 -07:00
2 changed files with 18 additions and 18 deletions

View file

@ -196,21 +196,23 @@ const prepend = (item: Item): void => {
if (props.pagination.reversed) { if (props.pagination.reversed) {
if (rootEl.value) { if (rootEl.value) {
const container = getScrollContainer(rootEl.value); const container = getScrollContainer(rootEl.value);
if (container == null) return; // TODO? if (container == null) {
// TODO?
const pos = getScrollPosition(rootEl.value); } else {
const viewHeight = container.clientHeight; const pos = getScrollPosition(rootEl.value);
const height = container.scrollHeight; const viewHeight = container.clientHeight;
const isBottom = (pos + viewHeight > height - 32); const height = container.scrollHeight;
if (isBottom) { const isBottom = (pos + viewHeight > height - 32);
// if (isBottom) {
if (items.value.length >= props.displayLimit) { //
// Vue 3.2 if (items.value.length >= props.displayLimit) {
//items.value = items.value.slice(-props.displayLimit); // Vue 3.2
while (items.value.length >= props.displayLimit) { //items.value = items.value.slice(-props.displayLimit);
items.value.shift(); while (items.value.length >= props.displayLimit) {
items.value.shift();
}
more.value = true;
} }
more.value = true;
} }
} }
} }

View file

@ -292,6 +292,7 @@ definePageMetadata(computed(() => !fetching ? user ? {
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-messaging-room { .mk-messaging-room {
position: relative; position: relative;
overflow: auto;
> .body { > .body {
.more { .more {
@ -335,10 +336,7 @@ definePageMetadata(computed(() => !fetching ? user ? {
z-index: 2; z-index: 2;
bottom: 0; bottom: 0;
padding-top: 8px; padding-top: 8px;
bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
@media (max-width: 500px) {
bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
}
> .new-message { > .new-message {
width: 100%; width: 100%;