aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/core/notification/user-notification-socket.service.ts15
-rw-r--r--client/src/app/shared/video/video-thumbnail.component.scss4
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.ts11
3 files changed, 18 insertions, 12 deletions
diff --git a/client/src/app/core/notification/user-notification-socket.service.ts b/client/src/app/core/notification/user-notification-socket.service.ts
index 493f03e35..3f22da476 100644
--- a/client/src/app/core/notification/user-notification-socket.service.ts
+++ b/client/src/app/core/notification/user-notification-socket.service.ts
@@ -1,4 +1,4 @@
1import { Injectable } from '@angular/core' 1import { Injectable, NgZone } from '@angular/core'
2import { environment } from '../../../environments/environment' 2import { environment } from '../../../environments/environment'
3import { UserNotification as UserNotificationServer } from '../../../../../shared' 3import { UserNotification as UserNotificationServer } from '../../../../../shared'
4import { Subject } from 'rxjs' 4import { Subject } from 'rxjs'
@@ -13,7 +13,8 @@ export class UserNotificationSocket {
13 private socket: SocketIOClient.Socket 13 private socket: SocketIOClient.Socket
14 14
15 constructor ( 15 constructor (
16 private auth: AuthService 16 private auth: AuthService,
17 private ngZone: NgZone
17 ) {} 18 ) {}
18 19
19 dispatch (type: NotificationEvent, notification?: UserNotificationServer) { 20 dispatch (type: NotificationEvent, notification?: UserNotificationServer) {
@@ -32,10 +33,12 @@ export class UserNotificationSocket {
32 // FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function 33 // FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function
33 const io: typeof import ('socket.io-client') = (await import('socket.io-client') as any).default 34 const io: typeof import ('socket.io-client') = (await import('socket.io-client') as any).default
34 35
35 this.socket = io(environment.apiUrl + '/user-notifications', { 36 this.ngZone.runOutsideAngular(() => {
36 query: { accessToken: this.auth.getAccessToken() } 37 this.socket = io(environment.apiUrl + '/user-notifications', {
37 }) 38 query: { accessToken: this.auth.getAccessToken() }
39 })
38 40
39 this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n)) 41 this.socket.on('new-notification', (n: UserNotificationServer) => this.dispatch('new', n))
42 })
40 } 43 }
41} 44}
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/video/video-thumbnail.component.scss
index e57baba5c..b9fd9182f 100644
--- a/client/src/app/shared/video/video-thumbnail.component.scss
+++ b/client/src/app/shared/video/video-thumbnail.component.scss
@@ -54,8 +54,8 @@ $play-overlay-width: 18px;
54 54
55 transition: all $play-overlay-transition; 55 transition: all $play-overlay-transition;
56 56
57 border-top: calc(#{$play-overlay-height} / 2) solid transparent; 57 border-top: ($play-overlay-height / 2) solid transparent;
58 border-bottom: calc(#{$play-overlay-height} / 2) solid transparent; 58 border-bottom: ($play-overlay-height / 2) solid transparent;
59 59
60 border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95); 60 border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95);
61 61
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index c7ebcec25..c80efd802 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -1,4 +1,4 @@
1import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' 2import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared' 4import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared'
@@ -62,7 +62,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
62 private router: Router, 62 private router: Router,
63 private notifier: Notifier, 63 private notifier: Notifier,
64 private serverService: ServerService, 64 private serverService: ServerService,
65 private i18nPrimengCalendarService: I18nPrimengCalendarService 65 private i18nPrimengCalendarService: I18nPrimengCalendarService,
66 private ngZone: NgZone
66 ) { 67 ) {
67 this.tagValidators = this.videoValidatorsService.VIDEO_TAGS.VALIDATORS 68 this.tagValidators = this.videoValidatorsService.VIDEO_TAGS.VALIDATORS
68 this.tagValidatorsMessages = this.videoValidatorsService.VIDEO_TAGS.MESSAGES 69 this.tagValidatorsMessages = this.videoValidatorsService.VIDEO_TAGS.MESSAGES
@@ -132,9 +133,11 @@ export class VideoEditComponent implements OnInit, OnDestroy {
132 this.videoLicences = this.serverService.getVideoLicences() 133 this.videoLicences = this.serverService.getVideoLicences()
133 this.videoLanguages = this.serverService.getVideoLanguages() 134 this.videoLanguages = this.serverService.getVideoLanguages()
134 135
135 this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute
136
137 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) 136 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)
137
138 this.ngZone.runOutsideAngular(() => {
139 this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute
140 })
138 } 141 }
139 142
140 ngOnDestroy () { 143 ngOnDestroy () {