From 589d9f55f6f3f0d069d4bbb207d3d20769cc4ded Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Aug 2019 15:46:56 +0200 Subject: Add config instance warning modal --- client/src/app/app.component.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'client/src/app/app.component.ts') diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index f68641047..6b18e5feb 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -244,15 +244,19 @@ export class AppComponent implements OnInit { if (user.noWelcomeModal !== true) return this.welcomeModal.show() const config = this.serverService.getConfig() - - if (user.noInstanceConfigWarningModal !== true && config.signup.allowed && config.instance.name.toLowerCase() === 'peertube') { - this.instanceService.getAbout() - .subscribe(about => { - if (!about.instance.terms) { - this.instanceConfigWarningModal.show() - } - }) - } + if (user.noInstanceConfigWarningModal === true || !config.signup.allowed) return + + this.instanceService.getAbout() + .subscribe(about => { + if ( + config.instance.name.toLowerCase() === 'peertube' || + !about.instance.terms || + !about.instance.administrator || + !about.instance.maintenanceLifetime + ) { + this.instanceConfigWarningModal.show(about) + } + }) } private initHotkeys () { -- cgit v1.2.3