mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-13 18:59:22 -05:00
fix: don't delete, set undefined
This commit is contained in:
parent
b3be822568
commit
cf049bd4ee
1 changed files with 13 additions and 1 deletions
|
@ -66,6 +66,8 @@ export default class State {
|
||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
this.register();
|
this.register();
|
||||||
this.setDisabled = this.setDisabled.bind(this);
|
this.setDisabled = this.setDisabled.bind(this);
|
||||||
|
|
||||||
|
this.client = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -202,7 +204,17 @@ export default class State {
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
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());
|
listeners.forEach((x) => x());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue