From bf80903fde923e0c84226ac442a2a382db74aee4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Aug 2021 09:26:45 +0200 Subject: Don't display account setup modal on signup Don't bother user with a modal just after signup --- client/src/app/modal/account-setup-modal.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src/app/modal') diff --git a/client/src/app/modal/account-setup-modal.component.ts b/client/src/app/modal/account-setup-modal.component.ts index e5d36e006..8256f5103 100644 --- a/client/src/app/modal/account-setup-modal.component.ts +++ b/client/src/app/modal/account-setup-modal.component.ts @@ -1,5 +1,5 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' -import { AuthService, ServerService, User } from '@app/core' +import { AuthService, ServerService, User, UserService } from '@app/core' import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' import { HTMLServerConfig } from '@shared/models' @@ -17,6 +17,7 @@ export class AccountSetupModalComponent implements OnInit { private serverConfig: HTMLServerConfig constructor ( + private userService: UserService, private authService: AuthService, private modalService: NgbModal, private serverService: ServerService @@ -49,8 +50,9 @@ export class AccountSetupModalComponent implements OnInit { this.authService.userInformationLoaded .subscribe( () => { - if (this.isUserRoot) return false - if (this.hasAccountAvatar && this.hasAccountDescription) return false + if (this.isUserRoot) return + if (this.hasAccountAvatar && this.hasAccountDescription) return + if (this.userService.hasSignupInThisSession()) return this.show() } @@ -58,7 +60,7 @@ export class AccountSetupModalComponent implements OnInit { } show () { - if (this.ref) return false + if (this.ref) return this.ref = this.modalService.open(this.modal, { centered: true, -- cgit v1.2.3