fix: Cannot read properties of undefined (reading 'id')
This commit is contained in:
@@ -5,19 +5,20 @@ import {
|
||||
Extension,
|
||||
} from "@hocuspocus/server";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { withContext } from "./types";
|
||||
|
||||
export default class LoggerExtension implements Extension {
|
||||
async onLoadDocument(data: onLoadDocumentPayload) {
|
||||
async onLoadDocument(data: withContext<onLoadDocumentPayload>) {
|
||||
Logger.info("multiplayer", `Loaded document "${data.documentName}"`, {
|
||||
userId: data.context.user?.id,
|
||||
});
|
||||
}
|
||||
|
||||
async onConnect(data: onConnectPayload) {
|
||||
async onConnect(data: withContext<onConnectPayload>) {
|
||||
Logger.info("multiplayer", `New connection to "${data.documentName}"`);
|
||||
}
|
||||
|
||||
async onDisconnect(data: onDisconnectPayload) {
|
||||
async onDisconnect(data: withContext<onDisconnectPayload>) {
|
||||
Logger.info("multiplayer", `Closed connection to "${data.documentName}"`, {
|
||||
userId: data.context.user?.id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user