From d12ebc3422e6616c4da2ffc7a3dca7f684600624 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 18 Jan 2023 21:35:38 +0100 Subject: [PATCH 01/21] potential fix --- packages/client/src/pages/messaging/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index 1966f29690..79cb1f7313 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -89,14 +89,14 @@ definePageMetadata({ const dmsPagination = { endpoint: 'messaging/history' as const, - limit: 15, + limit: 100, params: { group: false, }, }; const groupsPagination = { endpoint: 'messaging/history' as const, - limit: 5, + limit: 30, params: { group: true, }, From 58b2f7f138edaf2179bce0db86ee7118892249ce Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 18 Jan 2023 22:01:33 +0100 Subject: [PATCH 02/21] quick fix --- packages/client/src/pages/messaging/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index 79cb1f7313..c9d68ccaeb 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -89,7 +89,7 @@ definePageMetadata({ const dmsPagination = { endpoint: 'messaging/history' as const, - limit: 100, + limit: 99, params: { group: false, }, From 86bb42b52985e966ba207f604feb1071b0b1a15f Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 18 Jan 2023 23:48:05 +0100 Subject: [PATCH 03/21] YEET --- packages/client/src/components/MkPagination.vue | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index 3327a67966..95b86c51ab 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -278,17 +278,6 @@ const prepend = (item: Item): void => { // Prepend the item items.value.unshift(item); if(props.externalItemArray) props.externalItemArray.value.unshift(item); - - // オーバーフローしたら古いアイテムは捨てる - if (items.value.length >= props.displayLimit) { - // このやり方だとVue 3.2以降アニメーションが動かなくなる - //this.items = items.value.slice(0, props.displayLimit); - while (items.value.length >= props.displayLimit) { - items.value.pop(); - if(props.externalItemArray) props.externalItemArray.value.pop(); - } - more.value = true; - } } else { queue.value.push(item); onScrollTop(rootEl.value, () => { @@ -308,7 +297,8 @@ const append = (item: Item): void => { const removeItem = (finder: (item: Item) => boolean): boolean => { const i = items.value.findIndex(finder); - if (i === -1) { + const j = props.externalItemArray?.findIndex(finder); + if (i === -1 && j === -1) { return false; } @@ -319,7 +309,8 @@ const removeItem = (finder: (item: Item) => boolean): boolean => { const updateItem = (id: Item['id'], replacer: (old: Item) => Item): boolean => { const i = items.value.findIndex(item => item.id === id); - if (i === -1) { + const j = props.externalItemArray?.findIndex(item => item.id === id); + if (i === -1 && j === -1) { return false; } From f85f072b4b08338341c629adba8c85533ca51545 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 18 Jan 2023 23:54:59 +0100 Subject: [PATCH 04/21] chore: reformat MkPagination --- .../client/src/components/MkPagination.vue | 89 ++++++++++--------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index 95b86c51ab..84c79fe28a 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -1,34 +1,37 @@ - + + >.groupsbuttons { + max-width: 100%; + display: flex; + justify-content: center; + margin-bottom: 1rem; + } +} + From 91cc7af40adcc1cd0cdbd5888a926fb617c04b88 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Thu, 19 Jan 2023 00:29:04 +0100 Subject: [PATCH 09/21] wip --- packages/client/src/pages/messaging/index.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index ca4e3e3af5..8faca318e1 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -41,7 +41,7 @@