aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/modal/instance-config-warning-modal.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 10:15:55 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 10:15:55 +0200
commit8f581725651c4b2c213d75fc028e306bbf239d3e (patch)
tree8deb842327c2a227d8e302d9a84bd9f8f9f7affa /client/src/app/modal/instance-config-warning-modal.component.ts
parent1ff15061b31245df4248e47228d0a90b07ab3f01 (diff)
downloadPeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.tar.gz
PeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.tar.zst
PeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.zip
Allow accounts to skip account setup modal
Diffstat (limited to 'client/src/app/modal/instance-config-warning-modal.component.ts')
-rw-r--r--client/src/app/modal/instance-config-warning-modal.component.ts23
1 files changed, 18 insertions, 5 deletions
diff --git a/client/src/app/modal/instance-config-warning-modal.component.ts b/client/src/app/modal/instance-config-warning-modal.component.ts
index e40958976..300738a41 100644
--- a/client/src/app/modal/instance-config-warning-modal.component.ts
+++ b/client/src/app/modal/instance-config-warning-modal.component.ts
@@ -1,9 +1,9 @@
1import { Location } from '@angular/common' 1import { Location } from '@angular/common'
2import { Component, ElementRef, ViewChild } from '@angular/core' 2import { Component, ElementRef, ViewChild } from '@angular/core'
3import { Notifier, UserService } from '@app/core' 3import { Notifier, User, UserService } from '@app/core'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 5import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
6import { About } from '@shared/models/server' 6import { About, ServerConfig } from '@shared/models/server'
7 7
8@Component({ 8@Component({
9 selector: 'my-instance-config-warning-modal', 9 selector: 'my-instance-config-warning-modal',
@@ -27,10 +27,23 @@ export class InstanceConfigWarningModalComponent {
27 private notifier: Notifier 27 private notifier: Notifier
28 ) { } 28 ) { }
29 29
30 show (about: About) { 30 shouldOpenByUser (user: User) {
31 const result = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) 31 if (user.noInstanceConfigWarningModal === true) return false
32 if (result === 'true') return 32 if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) === 'true') return false
33
34 return true
35 }
36
37 shouldOpen (serverConfig: ServerConfig, about: About) {
38 if (!serverConfig.signup.allowed) return false
33 39
40 return serverConfig.instance.name.toLowerCase() === 'peertube' ||
41 !about.instance.terms ||
42 !about.instance.administrator ||
43 !about.instance.maintenanceLifetime
44 }
45
46 show (about: About) {
34 if (this.location.path().startsWith('/admin/config/edit-custom')) return 47 if (this.location.path().startsWith('/admin/config/edit-custom')) return
35 48
36 this.about = about 49 this.about = about