forked from MapComplete/MapComplete
Fix hiding and showing of features
This commit is contained in:
parent
d4f107c81a
commit
bc1863dcb6
12 changed files with 160 additions and 137 deletions
|
@ -77,7 +77,7 @@ export class UIEventSource<T> {
|
|||
}
|
||||
|
||||
public setData(t: T): UIEventSource<T> {
|
||||
if (this.data === t) {
|
||||
if (this.data == t) { // MUST COMPARE BY REFERENCE!
|
||||
return;
|
||||
}
|
||||
this.data = t;
|
||||
|
@ -86,8 +86,12 @@ export class UIEventSource<T> {
|
|||
}
|
||||
|
||||
public ping(): void {
|
||||
const old = this.data;
|
||||
for (const callback of this._callbacks) {
|
||||
callback(this.data);
|
||||
if(this.data === undefined && old !== undefined){
|
||||
throw "Something undefined the data!"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue