From 7661b1e79e38e2d52e514811d3853770326277ab Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Fri, 1 May 2020 16:18:39 -0400 Subject: [PATCH] Fixed bug that prevented admin creation prompt from occuring in the settings --- src/app/posts.services.ts | 4 ++-- src/app/settings/settings.component.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index a4bb0dcb..84c8edc1 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -436,8 +436,8 @@ export class PostsService implements CanActivate { password: password}, this.httpOptions); } - checkAdminCreationStatus() { - if (!this.config['Advanced']['multi_user_mode']) { + checkAdminCreationStatus(skip_check = false) { + if (!skip_check && !this.config['Advanced']['multi_user_mode']) { return; } this.adminExists().subscribe(res => { diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index c31c28ad..bc0ec810 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -65,7 +65,7 @@ export class SettingsComponent implements OnInit { if (res['success']) { if (!this.initial_config['Advanced']['multi_user_mode'] && this.new_config['Advanced']['multi_user_mode']) { // multi user mode was enabled, let's check if default admin account exists - this.postsService.checkAdminCreationStatus(); + this.postsService.checkAdminCreationStatus(true); } // sets new config as old config this.initial_config = JSON.parse(JSON.stringify(this.new_config));