correct observer hostConnected, to work thought it was destroyed

This commit is contained in:
Niels Lyngsø
2023-09-14 15:19:22 +02:00
committed by Jacob Overgaard
parent 9495ea315a
commit 74973d3b21

View File

@@ -46,7 +46,8 @@ export class UmbObserver<T> {
}
hostConnected() {
if (this.#subscription.closed) {
// Notice: This will not re-subscribe if this controller was destroyed. Only if the subscription was closed.
if (this.#subscription?.closed) {
this.#subscription = this.#source.subscribe(this.#callback);
}
}