From 8f581725651c4b2c213d75fc028e306bbf239d3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Aug 2021 10:15:55 +0200 Subject: Allow accounts to skip account setup modal --- client/src/app/app.component.html | 4 +- client/src/app/app.component.ts | 71 ++++++++++-------- client/src/app/app.module.ts | 8 +- client/src/app/core/users/user.model.ts | 2 + .../app/modal/account-setup-modal.component.html | 33 --------- .../app/modal/account-setup-modal.component.scss | 32 -------- .../src/app/modal/account-setup-modal.component.ts | 73 ------------------- .../account-setup-warning-modal.component.html | 39 ++++++++++ .../account-setup-warning-modal.component.scss | 32 ++++++++ .../modal/account-setup-warning-modal.component.ts | 79 ++++++++++++++++++++ .../app/modal/admin-welcome-modal.component.html | 85 ++++++++++++++++++++++ .../app/modal/admin-welcome-modal.component.scss | 77 ++++++++++++++++++++ .../src/app/modal/admin-welcome-modal.component.ts | 50 +++++++++++++ .../instance-config-warning-modal.component.ts | 23 ++++-- client/src/app/modal/welcome-modal.component.html | 85 ---------------------- client/src/app/modal/welcome-modal.component.scss | 77 -------------------- client/src/app/modal/welcome-modal.component.ts | 46 ------------ 17 files changed, 428 insertions(+), 388 deletions(-) delete mode 100644 client/src/app/modal/account-setup-modal.component.html delete mode 100644 client/src/app/modal/account-setup-modal.component.scss delete mode 100644 client/src/app/modal/account-setup-modal.component.ts create mode 100644 client/src/app/modal/account-setup-warning-modal.component.html create mode 100644 client/src/app/modal/account-setup-warning-modal.component.scss create mode 100644 client/src/app/modal/account-setup-warning-modal.component.ts create mode 100644 client/src/app/modal/admin-welcome-modal.component.html create mode 100644 client/src/app/modal/admin-welcome-modal.component.scss create mode 100644 client/src/app/modal/admin-welcome-modal.component.ts delete mode 100644 client/src/app/modal/welcome-modal.component.html delete mode 100644 client/src/app/modal/welcome-modal.component.scss delete mode 100644 client/src/app/modal/welcome-modal.component.ts (limited to 'client/src') diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index da66e4ef0..6969329e8 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -61,8 +61,8 @@ - - + + diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index ae6046cc1..86b687173 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -1,5 +1,6 @@ import { Hotkey, HotkeysService } from 'angular2-hotkeys' -import { filter, map, switchMap } from 'rxjs/operators' +import { forkJoin } from 'rxjs' +import { filter, first, map } from 'rxjs/operators' import { DOCUMENT, getLocaleDirection, PlatformLocation } from '@angular/common' import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core' import { DomSanitizer, SafeHtml } from '@angular/platform-browser' @@ -17,15 +18,15 @@ import { } from '@app/core' import { HooksService } from '@app/core/plugins/hooks.service' import { PluginService } from '@app/core/plugins/plugin.service' +import { AccountSetupWarningModalComponent } from '@app/modal/account-setup-warning-modal.component' import { CustomModalComponent } from '@app/modal/custom-modal.component' import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' -import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' -import { AccountSetupModalComponent } from '@app/modal/account-setup-modal.component' +import { AdminWelcomeModalComponent } from '@app/modal/admin-welcome-modal.component' import { NgbConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap' import { LoadingBarService } from '@ngx-loading-bar/core' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' import { getShortLocale } from '@shared/core-utils/i18n' -import { BroadcastMessageLevel, HTMLServerConfig, ServerConfig, UserRole } from '@shared/models' +import { BroadcastMessageLevel, HTMLServerConfig, UserRole } from '@shared/models' import { MenuService } from './core/menu/menu.service' import { POP_STATE_MODAL_DISMISS } from './helpers' import { InstanceService } from './shared/shared-instance' @@ -38,8 +39,8 @@ import { InstanceService } from './shared/shared-instance' export class AppComponent implements OnInit, AfterViewInit { private static BROADCAST_MESSAGE_KEY = 'app-broadcast-message-dismissed' - @ViewChild('accountSetupModal') accountSetupModal: AccountSetupModalComponent - @ViewChild('welcomeModal') welcomeModal: WelcomeModalComponent + @ViewChild('accountSetupWarningModal') accountSetupWarningModal: AccountSetupWarningModalComponent + @ViewChild('adminWelcomeModal') adminWelcomeModal: AdminWelcomeModalComponent @ViewChild('instanceConfigWarningModal') instanceConfigWarningModal: InstanceConfigWarningModalComponent @ViewChild('customModal') customModal: CustomModalComponent @@ -221,33 +222,41 @@ export class AppComponent implements OnInit, AfterViewInit { } private openModalsIfNeeded () { - this.authService.userInformationLoaded - .pipe( - map(() => this.authService.getUser()), - filter(user => user.role === UserRole.ADMINISTRATOR), - switchMap(user => { - return this.serverService.getConfig() - .pipe(map(serverConfig => ({ serverConfig, user }))) - }) - ).subscribe(({ serverConfig, user }) => this._openAdminModalsIfNeeded(serverConfig, user)) + const userSub = this.authService.userInformationLoaded + .pipe(map(() => this.authService.getUser())) + + // Admin modal + userSub.pipe( + filter(user => user.role === UserRole.ADMINISTRATOR) + ).subscribe(user => this.openAdminModalsIfNeeded(user)) + + // Account modal + userSub.pipe( + filter(user => user.role !== UserRole.ADMINISTRATOR) + ).subscribe(user => this.openAccountModalsIfNeeded(user)) } - private _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) { - if (user.noWelcomeModal !== true) return this.welcomeModal.show() - - if (user.noInstanceConfigWarningModal === true || !serverConfig.signup.allowed) return - - this.instanceService.getAbout() - .subscribe(about => { - if ( - this.serverConfig.instance.name.toLowerCase() === 'peertube' || - !about.instance.terms || - !about.instance.administrator || - !about.instance.maintenanceLifetime - ) { - this.instanceConfigWarningModal.show(about) - } - }) + private openAdminModalsIfNeeded (user: User) { + if (this.adminWelcomeModal.shouldOpen(user)) { + return this.adminWelcomeModal.show() + } + + if (!this.instanceConfigWarningModal.shouldOpenByUser(user)) return + + forkJoin([ + this.serverService.getConfig().pipe(first()), + this.instanceService.getAbout().pipe(first()) + ]).subscribe(([ config, about ]) => { + if (this.instanceConfigWarningModal.shouldOpen(config, about)) { + this.instanceConfigWarningModal.show(about) + } + }) + } + + private openAccountModalsIfNeeded (user: User) { + if (this.accountSetupWarningModal.shouldOpen(user)) { + this.accountSetupWarningModal.show(user) + } } private initHotkeys () { diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 8d9c39ad8..bb20c2d83 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -17,8 +17,8 @@ import { ConfirmComponent } from './modal/confirm.component' import { CustomModalComponent } from './modal/custom-modal.component' import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component' import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component' -import { WelcomeModalComponent } from './modal/welcome-modal.component' -import { AccountSetupModalComponent } from './modal/account-setup-modal.component' +import { AdminWelcomeModalComponent } from './modal/admin-welcome-modal.component' +import { AccountSetupWarningModalComponent } from './modal/account-setup-warning-modal.component' import { SharedActorImageModule } from './shared/shared-actor-image/shared-actor-image.module' import { SharedFormModule } from './shared/shared-forms' import { SharedGlobalIconModule } from './shared/shared-icons' @@ -54,9 +54,9 @@ export function loadConfigFactory (server: ServerService, pluginService: PluginS SuggestionComponent, HighlightPipe, - AccountSetupModalComponent, + AccountSetupWarningModalComponent, CustomModalComponent, - WelcomeModalComponent, + AdminWelcomeModalComponent, InstanceConfigWarningModalComponent, ConfirmComponent ], diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 7467519c4..00078af5d 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts @@ -55,6 +55,7 @@ export class User implements UserServerModel { noInstanceConfigWarningModal: boolean noWelcomeModal: boolean + noAccountSetupWarningModal: boolean pluginAuth: string | null @@ -98,6 +99,7 @@ export class User implements UserServerModel { this.noInstanceConfigWarningModal = hash.noInstanceConfigWarningModal this.noWelcomeModal = hash.noWelcomeModal + this.noAccountSetupWarningModal = hash.noAccountSetupWarningModal this.notificationSettings = hash.notificationSettings diff --git a/client/src/app/modal/account-setup-modal.component.html b/client/src/app/modal/account-setup-modal.component.html deleted file mode 100644 index d1f153835..000000000 --- a/client/src/app/modal/account-setup-modal.component.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/client/src/app/modal/account-setup-modal.component.scss b/client/src/app/modal/account-setup-modal.component.scss deleted file mode 100644 index d99edaf7a..000000000 --- a/client/src/app/modal/account-setup-modal.component.scss +++ /dev/null @@ -1,32 +0,0 @@ -@use '_mixins' as *; -@use '_variables' as *; - -.modal-body { - font-size: 15px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.mascot-fw { - width: 170px; -} - -.mascot { - @include margin-right(2rem); - - display: block; - width: 170px; - height: 220px; -} - -.subtitle { - font-weight: $font-semibold; - margin-bottom: 10px; - font-size: 16px; -} - -li { - margin-bottom: 10px; -} diff --git a/client/src/app/modal/account-setup-modal.component.ts b/client/src/app/modal/account-setup-modal.component.ts deleted file mode 100644 index 4cb8de2c7..000000000 --- a/client/src/app/modal/account-setup-modal.component.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' -import { AuthService, ServerService, User, UserService } from '@app/core' -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' -import { HTMLServerConfig } from '@shared/models' - -@Component({ - selector: 'my-account-setup-modal', - templateUrl: './account-setup-modal.component.html', - styleUrls: [ './account-setup-modal.component.scss' ] -}) -export class AccountSetupModalComponent implements OnInit { - @ViewChild('modal', { static: true }) modal: ElementRef - - user: User = null - ref: NgbModalRef = null - - private serverConfig: HTMLServerConfig - - constructor ( - private userService: UserService, - private authService: AuthService, - private modalService: NgbModal, - private serverService: ServerService - ) { } - - get userInformationLoaded () { - return this.authService.userInformationLoaded - } - - get instanceName () { - return this.serverConfig.instance.name - } - - get isUserRoot () { - return this.user.username === 'root' - } - - get hasAccountAvatar () { - return !!this.user.account.avatar - } - - get hasAccountDescription () { - return !!this.user.account.description - } - - ngOnInit () { - this.serverConfig = this.serverService.getHTMLConfig() - - this.authService.userInformationLoaded - .subscribe( - () => { - this.user = this.authService.getUser() - - if (this.isUserRoot) return - if (this.hasAccountAvatar && this.hasAccountDescription) return - if (this.userService.hasSignupInThisSession()) return - - this.show() - } - ) - } - - show () { - if (this.ref) return - - this.ref = this.modalService.open(this.modal, { - centered: true, - backdrop: 'static', - keyboard: false, - size: 'md' - }) - } -} diff --git a/client/src/app/modal/account-setup-warning-modal.component.html b/client/src/app/modal/account-setup-warning-modal.component.html new file mode 100644 index 000000000..614c0693d --- /dev/null +++ b/client/src/app/modal/account-setup-warning-modal.component.html @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/client/src/app/modal/account-setup-warning-modal.component.scss b/client/src/app/modal/account-setup-warning-modal.component.scss new file mode 100644 index 000000000..d99edaf7a --- /dev/null +++ b/client/src/app/modal/account-setup-warning-modal.component.scss @@ -0,0 +1,32 @@ +@use '_mixins' as *; +@use '_variables' as *; + +.modal-body { + font-size: 15px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.mascot-fw { + width: 170px; +} + +.mascot { + @include margin-right(2rem); + + display: block; + width: 170px; + height: 220px; +} + +.subtitle { + font-weight: $font-semibold; + margin-bottom: 10px; + font-size: 16px; +} + +li { + margin-bottom: 10px; +} diff --git a/client/src/app/modal/account-setup-warning-modal.component.ts b/client/src/app/modal/account-setup-warning-modal.component.ts new file mode 100644 index 000000000..c78de447d --- /dev/null +++ b/client/src/app/modal/account-setup-warning-modal.component.ts @@ -0,0 +1,79 @@ +import { Component, ElementRef, ViewChild } from '@angular/core' +import { Notifier, ServerService, User, UserService } from '@app/core' +import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' +import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' + +@Component({ + selector: 'my-account-setup-warning-modal', + templateUrl: './account-setup-warning-modal.component.html', + styleUrls: [ './account-setup-warning-modal.component.scss' ] +}) +export class AccountSetupWarningModalComponent { + @ViewChild('modal', { static: true }) modal: ElementRef + + stopDisplayModal = false + ref: NgbModalRef + + user: User + + private LOCAL_STORAGE_KEYS = { + NO_ACCOUNT_SETUP_WARNING_MODAL: 'no_account_setup_warning_modal' + } + + constructor ( + private userService: UserService, + private modalService: NgbModal, + private notifier: Notifier, + private serverService: ServerService + ) { } + + get instanceName () { + return this.serverService.getHTMLConfig().instance.name + } + + hasAccountAvatar (user: User) { + return !!user.account.avatar + } + + hasAccountDescription (user: User) { + return !!user.account.description + } + + shouldOpen (user: User) { + if (user.noAccountSetupWarningModal === true) return false + if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL) === 'true') return false + + if (this.hasAccountAvatar(user) && this.hasAccountDescription(user)) return false + if (this.userService.hasSignupInThisSession()) return false + + return true + } + + show (user: User) { + this.user = user + + if (this.ref) return + + this.ref = this.modalService.open(this.modal, { + centered: true, + backdrop: 'static', + keyboard: false, + size: 'md' + }) + + this.ref.result.finally(() => { + if (this.stopDisplayModal === true) this.doNotOpenAgain() + }) + } + + private doNotOpenAgain () { + peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL, 'true') + + this.userService.updateMyProfile({ noAccountSetupWarningModal: true }) + .subscribe({ + next: () => console.log('We will not open the account setup modal again.'), + + error: err => this.notifier.error(err.message) + }) + } +} diff --git a/client/src/app/modal/admin-welcome-modal.component.html b/client/src/app/modal/admin-welcome-modal.component.html new file mode 100644 index 000000000..f5d2b8799 --- /dev/null +++ b/client/src/app/modal/admin-welcome-modal.component.html @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/client/src/app/modal/admin-welcome-modal.component.scss b/client/src/app/modal/admin-welcome-modal.component.scss new file mode 100644 index 000000000..242a498d0 --- /dev/null +++ b/client/src/app/modal/admin-welcome-modal.component.scss @@ -0,0 +1,77 @@ +@use '_mixins' as *; +@use '_variables' as *; + +.modal-body { + font-size: 15px; +} + +.two-columns { + display: flex; + align-items: center; + justify-content: center; + margin-top: 50px; +} + +.mascot-fw { + width: 170px; +} + +.mascot { + @include margin-right(2rem); + + display: block; + min-width: 170px; +} + +.subtitle { + font-weight: $font-semibold; + margin-bottom: 10px; + font-size: 16px; +} + +.block-documentation { + .subtitle { + margin-bottom: 20px; + } +} + +li { + margin-bottom: 10px; +} + +.configure-instance { + text-align: center; + font-weight: 600; + font-size: 18px; + margin: 20px 0 40px; +} + +.columns { + display: flex; +} + +.link-block { + @include disable-default-a-behaviour; + + color: pvar(--mainForegroundColor); + padding: 10px; + transition: background-color 0.2s ease-in; + flex-basis: 33%; + + &:hover { + background-color: rgba(0, 0, 0, 0.05); + } + + .link-title { + font-size: 16px; + font-weight: $font-semibold; + display: flex; + justify-content: center; + margin-bottom: 5px; + } + + .link-title, + div { + text-align: center; + } +} diff --git a/client/src/app/modal/admin-welcome-modal.component.ts b/client/src/app/modal/admin-welcome-modal.component.ts new file mode 100644 index 000000000..3679f0847 --- /dev/null +++ b/client/src/app/modal/admin-welcome-modal.component.ts @@ -0,0 +1,50 @@ +import { Component, ElementRef, ViewChild } from '@angular/core' +import { Notifier, User, UserService } from '@app/core' +import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' + +@Component({ + selector: 'my-admin-welcome-modal', + templateUrl: './admin-welcome-modal.component.html', + styleUrls: [ './admin-welcome-modal.component.scss' ] +}) +export class AdminWelcomeModalComponent { + @ViewChild('modal', { static: true }) modal: ElementRef + + private LOCAL_STORAGE_KEYS = { + NO_WELCOME_MODAL: 'no_welcome_modal' + } + + constructor ( + private userService: UserService, + private modalService: NgbModal, + private notifier: Notifier + ) { } + + shouldOpen (user: User) { + if (user.noWelcomeModal === true) return false + if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL) === 'true') return false + + return true + } + + show () { + this.modalService.open(this.modal, { + centered: true, + backdrop: 'static', + keyboard: false, + size: 'lg' + }) + } + + doNotOpenAgain () { + peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL, 'true') + + this.userService.updateMyProfile({ noWelcomeModal: true }) + .subscribe({ + next: () => console.log('We will not open the welcome modal again.'), + + error: err => this.notifier.error(err.message) + }) + } +} 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 @@ import { Location } from '@angular/common' import { Component, ElementRef, ViewChild } from '@angular/core' -import { Notifier, UserService } from '@app/core' +import { Notifier, User, UserService } from '@app/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' -import { About } from '@shared/models/server' +import { About, ServerConfig } from '@shared/models/server' @Component({ selector: 'my-instance-config-warning-modal', @@ -27,10 +27,23 @@ export class InstanceConfigWarningModalComponent { private notifier: Notifier ) { } - show (about: About) { - const result = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) - if (result === 'true') return + shouldOpenByUser (user: User) { + if (user.noInstanceConfigWarningModal === true) return false + if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) === 'true') return false + + return true + } + + shouldOpen (serverConfig: ServerConfig, about: About) { + if (!serverConfig.signup.allowed) return false + return serverConfig.instance.name.toLowerCase() === 'peertube' || + !about.instance.terms || + !about.instance.administrator || + !about.instance.maintenanceLifetime + } + + show (about: About) { if (this.location.path().startsWith('/admin/config/edit-custom')) return this.about = about diff --git a/client/src/app/modal/welcome-modal.component.html b/client/src/app/modal/welcome-modal.component.html deleted file mode 100644 index f5d2b8799..000000000 --- a/client/src/app/modal/welcome-modal.component.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - diff --git a/client/src/app/modal/welcome-modal.component.scss b/client/src/app/modal/welcome-modal.component.scss deleted file mode 100644 index 242a498d0..000000000 --- a/client/src/app/modal/welcome-modal.component.scss +++ /dev/null @@ -1,77 +0,0 @@ -@use '_mixins' as *; -@use '_variables' as *; - -.modal-body { - font-size: 15px; -} - -.two-columns { - display: flex; - align-items: center; - justify-content: center; - margin-top: 50px; -} - -.mascot-fw { - width: 170px; -} - -.mascot { - @include margin-right(2rem); - - display: block; - min-width: 170px; -} - -.subtitle { - font-weight: $font-semibold; - margin-bottom: 10px; - font-size: 16px; -} - -.block-documentation { - .subtitle { - margin-bottom: 20px; - } -} - -li { - margin-bottom: 10px; -} - -.configure-instance { - text-align: center; - font-weight: 600; - font-size: 18px; - margin: 20px 0 40px; -} - -.columns { - display: flex; -} - -.link-block { - @include disable-default-a-behaviour; - - color: pvar(--mainForegroundColor); - padding: 10px; - transition: background-color 0.2s ease-in; - flex-basis: 33%; - - &:hover { - background-color: rgba(0, 0, 0, 0.05); - } - - .link-title { - font-size: 16px; - font-weight: $font-semibold; - display: flex; - justify-content: center; - margin-bottom: 5px; - } - - .link-title, - div { - text-align: center; - } -} diff --git a/client/src/app/modal/welcome-modal.component.ts b/client/src/app/modal/welcome-modal.component.ts deleted file mode 100644 index 06fe4cba5..000000000 --- a/client/src/app/modal/welcome-modal.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component, ElementRef, ViewChild } from '@angular/core' -import { Notifier, UserService } from '@app/core' -import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' - -@Component({ - selector: 'my-welcome-modal', - templateUrl: './welcome-modal.component.html', - styleUrls: [ './welcome-modal.component.scss' ] -}) -export class WelcomeModalComponent { - @ViewChild('modal', { static: true }) modal: ElementRef - - private LOCAL_STORAGE_KEYS = { - NO_WELCOME_MODAL: 'no_welcome_modal' - } - - constructor ( - private userService: UserService, - private modalService: NgbModal, - private notifier: Notifier - ) { } - - show () { - const result = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL) - if (result === 'true') return - - this.modalService.open(this.modal, { - centered: true, - backdrop: 'static', - keyboard: false, - size: 'lg' - }) - } - - doNotOpenAgain () { - peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL, 'true') - - this.userService.updateMyProfile({ noWelcomeModal: true }) - .subscribe({ - next: () => console.log('We will not open the welcome modal again.'), - - error: err => this.notifier.error(err.message) - }) - } -} -- cgit v1.2.3