fix: don't delete, set undefined

This commit is contained in:
Paul Makles 2022-03-28 09:51:35 +01:00
parent b3be822568
commit cf049bd4ee

View file

@ -66,6 +66,8 @@ export default class State {
makeAutoObservable(this);
this.register();
this.setDisabled = this.setDisabled.bind(this);
this.client = undefined;
}
/**
@ -202,7 +204,17 @@ export default class State {
});
return () => {
delete this.client;
// ! FIXME: quick fix
try {
try {
this.client = undefined;
} catch (err) {
reportError(err as any, "state_L207");
}
} catch (err) {
/** just for good measure */
}
listeners.forEach((x) => x());
};
}