mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 11:36:24 +01:00
cleanup
This commit is contained in:
parent
ac319bdafd
commit
24ebf6c559
@ -64,7 +64,7 @@ export class TurnServerSource {
|
||||
},
|
||||
() => {
|
||||
// start loop on first subscribe
|
||||
this.runLoop(this.currentObservable!, settings?.ttl ?? DEFAULT_TTL);
|
||||
this.runLoop(settings?.ttl ?? DEFAULT_TTL);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ export class TurnServerSource {
|
||||
});
|
||||
}
|
||||
|
||||
private async runLoop(observable: ObservableValue<RTCIceServer>, initialTtl: number): Promise<void> {
|
||||
private async runLoop(initialTtl: number): Promise<void> {
|
||||
let ttl = initialTtl;
|
||||
this.isPolling = true;
|
||||
while(this.isPolling) {
|
||||
@ -83,8 +83,8 @@ export class TurnServerSource {
|
||||
const settings = await this.doRequest(undefined);
|
||||
if (settings) {
|
||||
const iceServer = toIceServer(settings);
|
||||
if (shouldUpdate(observable, iceServer)) {
|
||||
observable.set(iceServer);
|
||||
if (shouldUpdate(this.currentObservable!, iceServer)) {
|
||||
this.currentObservable!.set(iceServer);
|
||||
}
|
||||
if (settings.ttl > 0) {
|
||||
ttl = settings.ttl;
|
||||
|
Loading…
Reference in New Issue
Block a user