Skip to content

Commit 984cdbe

Browse files
committed
added explicit 'void' and adjusted translatorSettingsEnabled condition
1 parent 0dfe154 commit 984cdbe

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,11 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
385385
}
386386

387387
get translatorSettingsEnabled(): boolean {
388-
return (this.translationSuggestionsProjectEnabled || this.lynxProjectEnabled) && this.userHasGeneralEditRight;
388+
return (
389+
((this.hasSource && this.hasSourceViewRight && this.translationSuggestionsProjectEnabled) ||
390+
this.lynxProjectEnabled) &&
391+
this.userHasGeneralEditRight
392+
);
389393
}
390394

391395
get numSuggestions(): number {

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/translator-settings-dialog.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ export class TranslatorSettingsDialogComponent implements OnInit {
6666
map(value => value / 100),
6767
quietTakeUntilDestroyed(this.destroyRef)
6868
)
69-
.subscribe(threshold =>
70-
this.projectUserConfigDoc.submitJson0Op(op => op.set(puc => puc.confidenceThreshold, threshold))
69+
.subscribe(
70+
threshold =>
71+
void this.projectUserConfigDoc.submitJson0Op(op => op.set(puc => puc.confidenceThreshold, threshold))
7172
);
7273
}
7374

@@ -84,7 +85,7 @@ export class TranslatorSettingsDialogComponent implements OnInit {
8485
}
8586

8687
set numSuggestions(value: string) {
87-
this.projectUserConfigDoc.submitJson0Op(op => op.set(puc => puc.numSuggestions, parseInt(value, 10)));
88+
void this.projectUserConfigDoc.submitJson0Op(op => op.set(puc => puc.numSuggestions, parseInt(value, 10)));
8889
}
8990

9091
get confidenceThreshold(): number {
@@ -127,7 +128,9 @@ export class TranslatorSettingsDialogComponent implements OnInit {
127128
}
128129

129130
setTranslationSettingsEnabled(value: boolean): void {
130-
this.projectUserConfigDoc.submitJson0Op(op => op.set<boolean>(puc => puc.translationSuggestionsEnabled, value));
131+
void this.projectUserConfigDoc.submitJson0Op(op =>
132+
op.set<boolean>(puc => puc.translationSuggestionsEnabled, value)
133+
);
131134
}
132135

133136
updateTranslationSuggestionsSwitch(): void {
@@ -154,7 +157,7 @@ export class TranslatorSettingsDialogComponent implements OnInit {
154157
}
155158

156159
private updateLynxInsightState(updates: { assessmentsEnabled?: boolean; autoCorrectionsEnabled?: boolean }): void {
157-
this.projectUserConfigDoc.submitJson0Op(op => {
160+
void this.projectUserConfigDoc.submitJson0Op(op => {
158161
for (const [key, value] of Object.entries(updates)) {
159162
op.set(puc => puc.lynxInsightState![key], value);
160163
}

0 commit comments

Comments
 (0)