Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ export class NoteThreadEmbed extends QuillEmbedBlot {
};
}

appendChild(_child: Node): void {
// An embed cannot have children. As such, we will just ignore this request.
// This function can be called by wrap() if the embed is inside an inline of block,
// and this embed is having a format applied to it (i.e. 'highlight' in EditorComponent).
}

format(name: string, value: any): void {
if (name === NoteThreadEmbed.blotName && value != null) {
const ref = value as NoteThread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,17 +748,15 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
this.userService.currentUserId
);

this.initLynxFeatureStates(this.projectUserConfigDoc);

this.sourceProjectDoc = await this.getSourceProjectDoc();
if (this.projectUserConfigChangesSub != null) {
this.projectUserConfigChangesSub.unsubscribe();
}
this.projectUserConfigChangesSub = this.projectUserConfigDoc.remoteChanges$.subscribe(() => {
this.projectUserConfigChangesSub = this.projectUserConfigDoc.remoteChanges$.subscribe(async () => {
if (this.projectUserConfigDoc?.data != null) {
// Reload config if the checksum has been reset on the server
if (this.projectUserConfigDoc.data.selectedSegmentChecksum == null) {
this.loadProjectUserConfig();
await this.loadProjectUserConfig();
} else {
this.loadTranslateSuggesterConfidence();
}
Expand Down Expand Up @@ -789,7 +787,10 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
this.updateVerseNumber();

// Set chapter from route if provided
this.loadProjectUserConfig(chapterNum != null ? Number.parseInt(chapterNum) : undefined);
await this.loadProjectUserConfig(chapterNum != null ? Number.parseInt(chapterNum) : undefined);

// Lynx must be initialized after the adding of notes and other text-change related events
this.initLynxFeatureStates(this.projectUserConfigDoc);

if (this.projectDoc.id !== prevProjectId) {
this.setupTranslationEngine();
Expand Down Expand Up @@ -2024,7 +2025,7 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
});
}

private loadProjectUserConfig(chapterFromUrl?: number): void {
private async loadProjectUserConfig(chapterFromUrl?: number): Promise<void> {
let chapter: number = chapterFromUrl ?? this.chapters[0] ?? 1;
this.loadTranslateSuggesterConfidence();

Expand All @@ -2046,10 +2047,10 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
}
this.toggleNoteThreadVerses(false);
this.chapter$.next(chapter);
this.changeText();
await this.changeText();
this.toggleNoteThreadVerses(true);
this.updateAutoDraftTabVisibility();
this.updateBiblicalTermsTabVisibility();
await this.updateAutoDraftTabVisibility();
await this.updateBiblicalTermsTabVisibility();
}

private loadTranslateSuggesterConfidence(): void {
Expand Down
Loading