Merge pull request #4692 from FinnStutzenstein/reloadOnPrioritizedProjectorclients

Refresh projector data after *every* (re)connect (closes #4691)
This commit is contained in:
Norman Jäckel 2019-05-10 12:41:24 +02:00 committed by GitHub
commit ba9fcef5a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View File

@ -48,7 +48,7 @@ export class OpenSlidesService {
) { ) {
// Handler that gets called, if the websocket connection reconnects after a disconnection. // Handler that gets called, if the websocket connection reconnects after a disconnection.
// There might have changed something on the server, so we check the operator, if he changed. // There might have changed something on the server, so we check the operator, if he changed.
websocketService.reconnectEvent.subscribe(() => { websocketService.retryReconnectEvent.subscribe(() => {
this.checkOperator(); this.checkOperator();
}); });

View File

@ -51,7 +51,7 @@ export class ProjectorDataService {
}); });
}); });
this.websocketService.reconnectEvent.subscribe(() => this.updateProjectorDataSubscription()); this.websocketService.connectEvent.subscribe(() => this.updateProjectorDataSubscription());
} }
/** /**

View File

@ -54,15 +54,16 @@ export class WebsocketService {
private connectionErrorNotice: MatSnackBarRef<SimpleSnackBar>; private connectionErrorNotice: MatSnackBarRef<SimpleSnackBar>;
/** /**
* Subjects that will be called, if a reconnect was successful. * Subjects that will be called, if a reconnect after a retry (e.g. with a previous
* connection loss) was successful.
*/ */
private _reconnectEvent: EventEmitter<void> = new EventEmitter<void>(); private _retryReconnectEvent: EventEmitter<void> = new EventEmitter<void>();
/** /**
* Getter for the reconnect event. * Getter for the retry reconnect event.
*/ */
public get reconnectEvent(): EventEmitter<void> { public get retryReconnectEvent(): EventEmitter<void> {
return this._reconnectEvent; return this._retryReconnectEvent;
} }
/** /**
@ -195,10 +196,10 @@ export class WebsocketService {
if (retry) { if (retry) {
this.dismissConnectionErrorNotice(); this.dismissConnectionErrorNotice();
this._reconnectEvent.emit(); this._retryReconnectEvent.emit();
} }
this._connectEvent.emit();
this._connectionOpen = true; this._connectionOpen = true;
this._connectEvent.emit();
this.sendQueueWhileNotConnected.forEach(entry => { this.sendQueueWhileNotConnected.forEach(entry => {
this.websocket.send(entry); this.websocket.send(entry);
}); });