Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Correctly hide new feature popup

Chocobozzz3cd38da9bf56
diff --git a/client/src/app/+my-library/my-channel-space.component.ts b/client/src/app/+my-library/my-channel-space.component.ts
index 697f10e082..517ee6adc4 100644
--- a/client/src/app/+my-library/my-channel-space.component.ts
+++ b/client/src/app/+my-library/my-channel-space.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, inject } from '@angular/core'
import { RouterOutlet } from '@angular/router'
import { ServerService } from '@app/core'
+import { NewFeatureInfoService } from '@app/modal/new-feature-info.service'
import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
import { HTMLServerConfig } from '@peertube/peertube-models'
@@ -10,6 +11,7 @@ import { HTMLServerConfig } from '@peertube/peertube-models'
})
export class MyChannelSpaceComponent implements OnInit {
private serverService = inject(ServerService)
+ private newFeatureInfoService = inject(NewFeatureInfoService)
menuEntries: HorizontalMenuEntry[] = []
@@ -19,6 +21,8 @@ export class MyChannelSpaceComponent implements OnInit {
this.serverConfig = this.serverService.getHTMLConfig()
this.buildMenu()
+
+ this.newFeatureInfoService.showChannelCollaboration()
}
private buildMenu () {
diff --git a/client/src/app/modal/new-feature-info.service.ts b/client/src/app/modal/new-feature-info.service.ts
index 2e143b36a2..a69b6f5f0b 100644
--- a/client/src/app/modal/new-feature-info.service.ts
+++ b/client/src/app/modal/new-feature-info.service.ts
@@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core'
import { AuthService, Notifier, ServerService, UserService } from '@app/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { UserNewFeatureInfo } from '@peertube/peertube-models'
+import { first } from 'rxjs'
import { NewFeatureInfoModalComponent } from './new-feature-info-modal.component'
@Injectable({ providedIn: 'root' })
@@ -13,7 +14,7 @@ export class NewFeatureInfoService {
private notifier = inject(Notifier)
showChannelCollaboration () {
- this.auth.userInformationLoaded.subscribe(() => {
+ this.auth.userInformationLoaded.pipe(first()).subscribe(() => {
const config = this.serverService.getHTMLConfig()
if (config.client.newFeaturesInfo !== true) return
@@ -25,16 +26,14 @@ export class NewFeatureInfoService {
const modalRef = this.modalService.open(NewFeatureInfoModalComponent, { size: 'lg', centered: true })
const component = modalRef.componentInstance as NewFeatureInfoModalComponent
- component.title = $localize`Collaborations on channels are coming to ${instanceName}`
+ component.title = $localize`Collaboration on channels are coming to ${instanceName}`
component.iconName = 'channel'
component.html = $localize`You can now <strong>invite other users</strong> to collaborate on your channel`
modalRef.result.finally(() => {
this.userService.markNewFeatureInfoAsRead(UserNewFeatureInfo.CHANNEL_COLLABORATION)
.subscribe({
- next: () => {
- // empty
- },
+ next: () => this.auth.refreshUserInformation(),
error: err => this.notifier.error(err.message)
})