fix: remove notes count

This commit is contained in:
Namekuji 2023-08-30 14:50:15 -04:00
parent 2ce855d23c
commit ed26870807
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532
3 changed files with 15 additions and 12 deletions

View file

@ -35,7 +35,7 @@ export default define(meta, paramDef, async (ps, user) => {
id: ps.channelId,
});
if (channel == null) {
if (!channel) {
throw new ApiError(meta.errors.noSuchChannel);
}

View file

@ -4,6 +4,7 @@ import { isUserRelated } from "@/misc/is-user-related.js";
import type { User } from "@/models/entities/user.js";
import type { StreamMessages } from "../types.js";
import type { Packed } from "@/misc/schema.js";
import { scyllaClient } from "@/db/scylla.js";
export default class extends Channel {
public readonly chName = "channel";
@ -45,7 +46,7 @@ export default class extends Channel {
}
private onEvent(data: StreamMessages["channel"]["payload"]) {
if (data.type === "typing") {
if (data.type === "typing" && !scyllaClient) {
const id = data.body;
const begin = !this.typers.has(id);
this.typers.set(id, new Date());

View file

@ -651,6 +651,7 @@ export default async (
lastNotedAt: new Date(),
});
if (!scyllaClient) {
await Notes.countBy({
userId: user.id,
channelId: data.channel.id,
@ -662,6 +663,7 @@ export default async (
}
});
}
}
// Register to search database
await index(note, false);