mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-03 00:19:57 -04:00
fix(realtime): use number[] for transport but ArrayBuffer for database
Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
21a1f35281
commit
4869f3310c
9 changed files with 37 additions and 28 deletions
|
@ -31,7 +31,7 @@ export class RealtimeNoteStore {
|
|||
const realtimeNote = new RealtimeNote(
|
||||
noteId,
|
||||
initialTextContent,
|
||||
initialYjsState,
|
||||
initialYjsState ? Array.from(new Uint8Array(initialYjsState)) : undefined,
|
||||
);
|
||||
realtimeNote.on('destroy', () => {
|
||||
this.noteIdToRealtimeNote.delete(noteId);
|
||||
|
|
|
@ -49,7 +49,7 @@ export class RealtimeNoteService implements BeforeApplicationShutdown {
|
|||
realtimeNote.getRealtimeDoc().getCurrentContent(),
|
||||
false,
|
||||
undefined,
|
||||
realtimeNote.getRealtimeDoc().encodeStateAsUpdate(),
|
||||
new Uint8Array(realtimeNote.getRealtimeDoc().encodeStateAsUpdate()),
|
||||
)
|
||||
.then(() => {
|
||||
realtimeNote.announceMetadataUpdate();
|
||||
|
|
|
@ -34,7 +34,7 @@ export class RealtimeNote extends EventEmitter2<RealtimeNoteEventMap> {
|
|||
constructor(
|
||||
private readonly noteId: number,
|
||||
initialTextContent: string,
|
||||
initialYjsState?: ArrayBuffer,
|
||||
initialYjsState?: number[],
|
||||
) {
|
||||
super();
|
||||
this.logger = new Logger(`${RealtimeNote.name} ${noteId}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue