Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Nov 21, 2023
1 parent dc4c61a commit 76b8b5b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packages/backend/src/server/api/endpoints/notes/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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 [];
Expand Down Expand Up @@ -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();
Expand Down
18 changes: 9 additions & 9 deletions packages/frontend/src/components/MkPostFormSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/src/components/MkTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,30 +188,30 @@ 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';
query = {
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';
query = {
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';
Expand All @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/global/MkTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() }) :
Expand All @@ -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() })
);
);
}
});

Expand Down

0 comments on commit 76b8b5b

Please sign in to comment.