[DURACOM-240] refactor variable

This commit is contained in:
Andrea Barbasso
2024-02-27 10:23:56 +01:00
committed by Giuseppe Digilio
parent e402ac482d
commit e1ba78c443

View File

@@ -16,7 +16,7 @@ import {
})
export class ClientMathService extends MathService {
protected signal: Subject<boolean>;
protected isReady$: Subject<boolean>;
protected mathJaxOptions = {
tex: {
@@ -42,14 +42,13 @@ export class ClientMathService extends MathService {
constructor() {
super();
this.signal = new ReplaySubject<boolean>(1);
this.isReady$ = new ReplaySubject<boolean>(1);
void this.registerMathJaxAsync(this.mathJax)
.then(() => this.signal.next(true))
.then(() => this.isReady$.next(true))
.catch(_ => {
void this.registerMathJaxAsync(this.mathJaxFallback)
.then(() => this.signal.next(true))
.catch((error) => console.log(error));
.then(() => this.isReady$.next(true));
});
}
@@ -77,7 +76,7 @@ export class ClientMathService extends MathService {
}
ready(): Observable<boolean> {
return this.signal;
return this.isReady$;
}
render(element: HTMLElement) {