summaryrefslogtreecommitdiff
path: root/packages/client/src/components
diff options
context:
space:
mode:
authorKainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com>2022-07-22 08:46:52 -0700
committerGitHub <noreply@github.com>2022-07-23 00:46:52 +0900
commite371120c8bc4300779d4e6d9b2b6f221d6aabe69 (patch)
tree559bd1609476fdf2fd39c42753e46b00e323f069 /packages/client/src/components
parentUpdate CHANGELOG.md (diff)
downloadsharkey-e371120c8bc4300779d4e6d9b2b6f221d6aabe69.tar.gz
sharkey-e371120c8bc4300779d4e6d9b2b6f221d6aabe69.tar.bz2
sharkey-e371120c8bc4300779d4e6d9b2b6f221d6aabe69.zip
fix: broken chats (#8983)
* Fix broken chats Co-authored-by: @ltlapy * :art:
Diffstat (limited to 'packages/client/src/components')
-rw-r--r--packages/client/src/components/ui/pagination.vue30
1 files changed, 16 insertions, 14 deletions
diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue
index 063dc2d47c..7650c5b33a 100644
--- a/packages/client/src/components/ui/pagination.vue
+++ b/packages/client/src/components/ui/pagination.vue
@@ -197,21 +197,23 @@ const prepend = (item: Item): void => {
if (props.pagination.reversed) {
if (rootEl.value) {
const container = getScrollContainer(rootEl.value);
- if (container == null) return; // TODO?
-
- const pos = getScrollPosition(rootEl.value);
- const viewHeight = container.clientHeight;
- const height = container.scrollHeight;
- const isBottom = (pos + viewHeight > height - 32);
- if (isBottom) {
- // オーバーフローしたら古いアイテムは捨てる
- if (items.value.length >= props.displayLimit) {
- // このやり方だとVue 3.2以降アニメーションが動かなくなる
- //items.value = items.value.slice(-props.displayLimit);
- while (items.value.length >= props.displayLimit) {
- items.value.shift();
+ if (container == null) {
+ // TODO?
+ } else {
+ const pos = getScrollPosition(rootEl.value);
+ const viewHeight = container.clientHeight;
+ const height = container.scrollHeight;
+ const isBottom = (pos + viewHeight > height - 32);
+ if (isBottom) {
+ // オーバーフローしたら古いアイテムは捨てる
+ if (items.value.length >= props.displayLimit) {
+ // このやり方だとVue 3.2以降アニメーションが動かなくなる
+ //items.value = items.value.slice(-props.displayLimit);
+ while (items.value.length >= props.displayLimit) {
+ items.value.shift();
+ }
+ more.value = true;
}
- more.value = true;
}
}
}