fix: clip note selector
This commit is contained in:
parent
6eb2f713f7
commit
a5980370de
1 changed files with 5 additions and 2 deletions
|
@ -90,9 +90,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const noteIds = await ClipNotes.find({
|
const noteIds = await ClipNotes.find({
|
||||||
select: ["noteId"],
|
|
||||||
where: whereOpt,
|
where: whereOpt,
|
||||||
order: { noteId: "DESC" },
|
order: { id: "DESC" },
|
||||||
take: ps.limit * 5,
|
take: ps.limit * 5,
|
||||||
}).then((clips) => clips.map(({ noteId }) => noteId));
|
}).then((clips) => clips.map(({ noteId }) => noteId));
|
||||||
|
|
||||||
|
@ -101,6 +100,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let [
|
let [
|
||||||
|
followingUserIds,
|
||||||
mutedUserIds,
|
mutedUserIds,
|
||||||
mutedInstances,
|
mutedInstances,
|
||||||
blockerIds,
|
blockerIds,
|
||||||
|
@ -109,12 +109,14 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
let mutedWords: string[][];
|
let mutedWords: string[][];
|
||||||
if (user) {
|
if (user) {
|
||||||
[
|
[
|
||||||
|
followingUserIds,
|
||||||
mutedUserIds,
|
mutedUserIds,
|
||||||
mutedInstances,
|
mutedInstances,
|
||||||
mutedWords,
|
mutedWords,
|
||||||
blockerIds,
|
blockerIds,
|
||||||
blockingIds,
|
blockingIds,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
|
LocalFollowingsCache.init(user.id).then((cache) => cache.getAll()),
|
||||||
UserMutingsCache.init(user.id).then((cache) => cache.getAll()),
|
UserMutingsCache.init(user.id).then((cache) => cache.getAll()),
|
||||||
InstanceMutingsCache.init(user.id).then((cache) => cache.getAll()),
|
InstanceMutingsCache.init(user.id).then((cache) => cache.getAll()),
|
||||||
userWordMuteCache
|
userWordMuteCache
|
||||||
|
@ -133,6 +135,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
const filter = async (notes: ScyllaNote[]) => {
|
const filter = async (notes: ScyllaNote[]) => {
|
||||||
let filtered = notes;
|
let filtered = notes;
|
||||||
if (user) {
|
if (user) {
|
||||||
|
filtered = await filterVisibility(filtered, user, followingUserIds);
|
||||||
filtered = await filterMutedUser(
|
filtered = await filterMutedUser(
|
||||||
filtered,
|
filtered,
|
||||||
user,
|
user,
|
||||||
|
|
Loading…
Reference in a new issue