From b7c874f58c14a7c98cab58656e0bdddfbb9ef941 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 13 Dec 2022 17:44:32 +0200 Subject: [PATCH] RED-5219: do not show warning again --- .../account/screens/preferences/preferences.component.ts | 4 ++-- .../app/modules/file-preview/file-preview-screen.component.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts b/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts index ea5fc8ed4..252299c5e 100644 --- a/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts @@ -50,7 +50,7 @@ export class PreferencesComponent extends BaseFormComponent { displaySuggestionsInPreview: [this.userPreferenceService.getDisplaySuggestionsInPreview()], // warnings preferences unapprovedSuggestionsWarning: [this.userPreferenceService.getUnapprovedSuggestionsWarning()], - loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning, 'true')], + loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)], }); if (!this._permissionsService.has(ROLES.managePreferences)) { @@ -74,7 +74,7 @@ export class PreferencesComponent extends BaseFormComponent { if ( this.form.controls.loadAllAnnotationsWarning.value !== - this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning, 'true') + this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning) ) { await this.userPreferenceService.save( PreferencesKeys.loadAllAnnotationsWarning, diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index cc93d8ec2..a5c863763 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -640,7 +640,7 @@ export class FilePreviewScreenComponent filter(event => event.type === ViewerEvents.LOAD_ALL_ANNOTATIONS), switchMap(() => this._fileDataService.annotations), switchMap>(annotations => { - const showWarning = this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning, 'true'); + const showWarning = !this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning); const annotationsExceedThreshold = annotations.length >= this.configService.values.ANNOTATIONS_THRESHOLD; if (annotationsExceedThreshold && showWarning) { @@ -663,7 +663,7 @@ export class FilePreviewScreenComponent switchMap(async (result: ConfirmOptions) => { const doNotShowWarningAgain = result === ConfirmOptions.SECOND_CONFIRM; if (doNotShowWarningAgain) { - await this.userPreferenceService.save(PreferencesKeys.loadAllAnnotationsWarning, 'false'); + await this.userPreferenceService.save(PreferencesKeys.loadAllAnnotationsWarning, 'true'); await this.userPreferenceService.reload(); } const shouldLoad = [ConfirmOptions.CONFIRM, ConfirmOptions.SECOND_CONFIRM].includes(result);