Merge pull request #4692 from FinnStutzenstein/reloadOnPrioritizedProjectorclients
Refresh projector data after *every* (re)connect (closes #4691)
This commit is contained in:
commit
ba9fcef5a1
@ -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();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ export class ProjectorDataService {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.websocketService.reconnectEvent.subscribe(() => this.updateProjectorDataSubscription());
|
this.websocketService.connectEvent.subscribe(() => this.updateProjectorDataSubscription());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user