mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
fix(commons): extract name of markdown content yjs channel into the commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
329a4d4e55
commit
11c2f57e4b
6 changed files with 22 additions and 13 deletions
7
commons/src/constants/markdown-content-channel-name.ts
Normal file
7
commons/src/constants/markdown-content-channel-name.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const MARKDOWN_CONTENT_CHANNEL_NAME = 'markdownContent'
|
|
@ -33,3 +33,5 @@ export {
|
|||
export type { MessageTransporterEvents } from './y-doc-message-transporter.js'
|
||||
|
||||
export { waitForOtherPromisesToFinish } from './utils/wait-for-other-promises-to-finish.js'
|
||||
|
||||
export { MARKDOWN_CONTENT_CHANNEL_NAME } from './constants/markdown-content-channel-name.js'
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { MARKDOWN_CONTENT_CHANNEL_NAME } from './constants/markdown-content-channel-name.js'
|
||||
import { encodeDocumentUpdateMessage } from './messages/document-update-message.js'
|
||||
import { MessageType } from './messages/message-type.enum.js'
|
||||
import { YDocMessageTransporter } from './y-doc-message-transporter.js'
|
||||
|
@ -55,9 +56,9 @@ describe('message transporter', () =>
|
|||
const docClient2: Doc = new Doc()
|
||||
const dummyAwareness: Awareness = new Awareness(docServer)
|
||||
|
||||
const textServer = docServer.getText('markdownContent')
|
||||
const textClient1 = docClient1.getText('markdownContent')
|
||||
const textClient2 = docClient2.getText('markdownContent')
|
||||
const textServer = docServer.getText(MARKDOWN_CONTENT_CHANNEL_NAME)
|
||||
const textClient1 = docClient1.getText(MARKDOWN_CONTENT_CHANNEL_NAME)
|
||||
const textClient2 = docClient2.getText(MARKDOWN_CONTENT_CHANNEL_NAME)
|
||||
textServer.insert(0, 'This is a test note')
|
||||
|
||||
textServer.observe(() =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue