lint
This commit is contained in:
parent
dc4c61a7e7
commit
76b8b5b954
|
@ -118,9 +118,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
.leftJoinAndSelect('renote.user', 'renoteUser')
|
||||
.leftJoinAndSelect('note.channel', 'channel');
|
||||
|
||||
if (ps.withCats) {
|
||||
query.andWhere('(select "isCat" from "user" where id = note."userId")');
|
||||
}
|
||||
if (ps.withCats) {
|
||||
query.andWhere('(select "isCat" from "user" where id = note."userId")');
|
||||
}
|
||||
|
||||
redisTimeline = await query.getMany();
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
includeLocalRenotes: ps.includeLocalRenotes,
|
||||
withFiles: ps.withFiles,
|
||||
withRenotes: ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
withCats: ps.withCats,
|
||||
}, me);
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
includeLocalRenotes: ps.includeLocalRenotes,
|
||||
withFiles: ps.withFiles,
|
||||
withRenotes: ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
withCats: ps.withCats,
|
||||
}, me);
|
||||
} else {
|
||||
return [];
|
||||
|
@ -274,9 +274,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
query.andWhere('note.fileIds != \'{}\'');
|
||||
}
|
||||
|
||||
if (ps.withCats) {
|
||||
query.andWhere('(select "isCat" from "user" where id = note."userId")');
|
||||
}
|
||||
if (ps.withCats) {
|
||||
query.andWhere('(select "isCat" from "user" where id = note."userId")');
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const timeline = await query.limit(ps.limit).getMany();
|
||||
|
|
|
@ -827,15 +827,15 @@ async function post(ev?: MouseEvent) {
|
|||
}
|
||||
|
||||
// plugin
|
||||
if (notePostInterruptors.length > 0) {
|
||||
for (const interruptor of notePostInterruptors) {
|
||||
try {
|
||||
postData = await interruptor.handler(deepClone(postData));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notePostInterruptors.length > 0) {
|
||||
for (const interruptor of notePostInterruptors) {
|
||||
try {
|
||||
postData = await interruptor.handler(deepClone(postData));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let token = undefined;
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ function updatePaginationQuery() {
|
|||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
} else if (props.src === 'local') {
|
||||
endpoint = 'notes/local-timeline';
|
||||
|
@ -196,7 +196,7 @@ function updatePaginationQuery() {
|
|||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
} else if (props.src === 'social') {
|
||||
endpoint = 'notes/hybrid-timeline';
|
||||
|
@ -204,14 +204,14 @@ function updatePaginationQuery() {
|
|||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
} else if (props.src === 'global') {
|
||||
endpoint = 'notes/global-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
};
|
||||
} else if (props.src === 'mentions') {
|
||||
endpoint = 'notes/mentions';
|
||||
|
@ -225,7 +225,7 @@ function updatePaginationQuery() {
|
|||
endpoint = 'notes/user-list-timeline';
|
||||
query = {
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
withCats: props.onlyCats,
|
||||
withCats: props.onlyCats,
|
||||
listId: props.list,
|
||||
};
|
||||
} else if (props.src === 'channel') {
|
||||
|
|
|
@ -53,7 +53,7 @@ const relative = $computed<string>(() => {
|
|||
ago < -3600 ? i18n.t('_timeIn.hours', { n: Math.round(-ago / 3600).toString() }) :
|
||||
ago < -60 ? i18n.t('_timeIn.minutes', { n: (~~(-ago / 60)).toString() }) :
|
||||
i18n.t('_timeIn.seconds', { n: (~~(-ago % 60)).toString() })
|
||||
);
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
ago >= 31536000 ? i18n.t('_ago.yearsAgo', { n: Math.round(ago / 31536000).toString() }) :
|
||||
|
@ -71,7 +71,7 @@ const relative = $computed<string>(() => {
|
|||
ago < -3600 ? i18n.t('_timeIn.hours', { n: Math.round(-ago / 3600).toString() }) :
|
||||
ago < -60 ? i18n.t('_timeIn.minutes', { n: (~~(-ago / 60)).toString() }) :
|
||||
i18n.t('_timeIn.seconds', { n: (~~(-ago % 60)).toString() })
|
||||
);
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue