Feat: 絵文字申請中のやつのテーブルを分けた

Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
mattyatea 2023-10-21 16:29:09 +09:00
parent 97590f2567
commit fe938bf8e6
No known key found for this signature in database
GPG key ID: 068E54E2C33BEF9A
29 changed files with 666 additions and 189 deletions

View file

@ -201,11 +201,13 @@ async function init(): Promise<void> {
...params,
limit: props.pagination.limit ?? 10,
}).then(res => {
if (props.pagination.endpoint === 'emoji-drafts') {
res = res.emojis;
}
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 3) item._shouldInsertAd_ = true;
}
if (res.length === 0 || props.pagination.noPaging) {
concatItems(res);
more.value = false;
@ -214,7 +216,6 @@ async function init(): Promise<void> {
concatItems(res);
more.value = true;
}
offset.value = res.length;
error.value = false;
fetching.value = false;
@ -241,6 +242,9 @@ const fetchMore = async (): Promise<void> => {
untilId: Array.from(items.value.keys()).at(-1),
}),
}).then(res => {
if (props.pagination.endpoint === 'emoji-drafts') {
res = res.emojis;
}
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 10) item._shouldInsertAd_ = true;
@ -305,6 +309,9 @@ const fetchMoreAhead = async (): Promise<void> => {
sinceId: Array.from(items.value.keys()).at(-1),
}),
}).then(res => {
if (props.pagination.endpoint === 'emoji-drafts') {
res = res.emojis;
}
if (res.length === 0) {
items.value = concatMapWithArray(items.value, res);
more.value = false;