RED-5219: do not show warning again
This commit is contained in:
parent
c97782f886
commit
b7c874f58c
@ -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,
|
||||
|
||||
@ -640,7 +640,7 @@ export class FilePreviewScreenComponent
|
||||
filter(event => event.type === ViewerEvents.LOAD_ALL_ANNOTATIONS),
|
||||
switchMap(() => this._fileDataService.annotations),
|
||||
switchMap<AnnotationWrapper[], Observable<readonly [boolean, AnnotationWrapper[]]>>(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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user