mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 06:23:03 +00:00
[DURACOM-240] refactor variable
This commit is contained in:

committed by
Giuseppe Digilio

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