Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/superdoc/src/core/SuperDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class SuperDoc extends EventEmitter {

// @ts-ignore
this.version = __APP_VERSION__;
console.debug('πŸ¦‹ [superdoc] Using SuperDoc version:', this.version);
this.#log('πŸ¦‹ [superdoc] Using SuperDoc version:', this.version);

this.superdocId = config.superdocId || uuidv4();
this.colors = this.config.colors;
Expand Down Expand Up @@ -478,8 +478,8 @@ export class SuperDoc extends EventEmitter {
this.emit('sidebar-toggle', isOpened);
}

log(...args) {
console.debug('πŸ¦‹ πŸ¦Έβ€β™€οΈ [superdoc]', ...args);
#log(...args) {
(console.debug ? console.debug : console.log)('πŸ¦‹ πŸ¦Έβ€β™€οΈ [superdoc]', ...args);
}

/**
Expand Down Expand Up @@ -558,7 +558,7 @@ export class SuperDoc extends EventEmitter {
*/
addCommentsList(element) {
if (!this.config?.modules?.comments || this.config.role === 'viewer') return;
console.debug('πŸ¦‹ [superdoc] Adding comments list to:', element);
this.#log('πŸ¦‹ [superdoc] Adding comments list to:', element);
if (element) this.config.modules.comments.element = element;
this.commentsList = new SuperComments(this.config.modules?.comments, this);
if (this.config.onCommentsListChange) this.config.onCommentsListChange({ isRendered: true });
Expand Down Expand Up @@ -718,7 +718,7 @@ export class SuperDoc extends EventEmitter {
lockSuperdoc(isLocked = false, lockedBy) {
this.isLocked = isLocked;
this.lockedBy = lockedBy;
console.debug('πŸ¦‹ [superdoc] Locking superdoc:', isLocked, lockedBy, '\n\n\n');
this.#log('πŸ¦‹ [superdoc] Locking superdoc:', isLocked, lockedBy, '\n\n\n');
this.emit('locked', { isLocked, lockedBy });
}

Expand Down Expand Up @@ -801,7 +801,7 @@ export class SuperDoc extends EventEmitter {
* @returns {Promise<void>} Resolves when all documents have saved
*/
async #triggerCollaborationSaves() {
console.debug('πŸ¦‹ [superdoc] Triggering collaboration saves');
this.#log('πŸ¦‹ [superdoc] Triggering collaboration saves');
return new Promise((resolve, reject) => {
this.superdocStore.documents.forEach((doc) => {
this.pendingCollaborationSaves = 0;
Expand Down Expand Up @@ -832,9 +832,9 @@ export class SuperDoc extends EventEmitter {
// this.exportEditorsToDOCX(),
];

console.debug('πŸ¦‹ [superdoc] Saving superdoc');
this.#log('πŸ¦‹ [superdoc] Saving superdoc');
const result = await Promise.all(savePromises);
console.debug('πŸ¦‹ [superdoc] Save complete:', result);
this.#log('πŸ¦‹ [superdoc] Save complete:', result);
return result;
}

Expand All @@ -847,7 +847,7 @@ export class SuperDoc extends EventEmitter {
return;
}

this.log('[superdoc] Unmounting app');
this.#log('[superdoc] Unmounting app');

this.config.socket?.cancelWebsocketRetry();
this.config.socket?.disconnect();
Expand Down
Loading