Skip to content

Commit

Permalink
fix outbound noises
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Oct 20, 2024
1 parent aae79a4 commit d75b4d3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions web/assets/js/model/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,16 +808,16 @@ Outbound.FreedomSettings = class extends CommonClass {
json.domainStrategy,
json.redirect,
json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined,
json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : [new Outbound.FreedomSettings.Noise()],
json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : undefined,
);
}

toJson() {
return {
domainStrategy: ObjectUtil.isEmpty(this.domainStrategy) ? undefined : this.domainStrategy,
redirect: this.redirect,
redirect: ObjectUtil.isEmpty(this.redirect) ? undefined: this.redirect,
fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment,
noises: Outbound.FreedomSettings.Noise.toJsonArray(this.noises),
noises: this.noises.length === 0 ? undefined : Outbound.FreedomSettings.Noise.toJsonArray(this.noises),
};
}
};
Expand Down Expand Up @@ -866,10 +866,6 @@ Outbound.FreedomSettings.Noise = class extends CommonClass {
delay: this.delay,
};
}

static toJsonArray(noises) {
return noises.map(noise => noise.toJson());
}
};

Outbound.BlackholeSettings = class extends CommonClass {
Expand Down

0 comments on commit d75b4d3

Please sign in to comment.