Fix profile loader

This commit is contained in:
2022-12-27 12:33:52 +00:00
parent ff9de60b6b
commit f42e183bc8
5 changed files with 44 additions and 22 deletions

View File

@ -56,7 +56,7 @@ export default class Connection {
*/
AddSubscription(sub) {
let req = ["REQ", sub.Id, sub.ToObject()];
if(sub.OrSubs.length > 0) {
if (sub.OrSubs.length > 0) {
req = [
...req,
...sub.OrSubs.map(o => o.ToObject())
@ -71,9 +71,13 @@ export default class Connection {
* @param {any} subId Subscription id to remove
*/
RemoveSubscription(subId) {
let req = ["CLOSE", subId];
this._SendJson(req);
delete this.Subscriptions[subId];
if (this.Subscriptions[subId]) {
let req = ["CLOSE", subId];
this._SendJson(req);
delete this.Subscriptions[subId];
return true;
}
return false;
}
_SendJson(obj) {