Skip to content

Commit

Permalink
switching back to deprecated constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
krpeacock committed Jun 26, 2024
1 parent 5c5ec14 commit ac655eb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/agent/src/agent/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ export class HttpAgent implements Agent {

/**
* @param options - Options for the HttpAgent
* @deprecated Use `HttpAgent.create` or `HttpAgent.createSync` instead
*/
protected constructor(options: HttpAgentOptions = {}) {
constructor(options: HttpAgentOptions = {}) {
this.config = options;
this.#fetch = options.fetch || getDefaultFetch() || fetch.bind(global);
this.#fetchOptions = options.fetchOptions;
Expand Down Expand Up @@ -405,7 +406,7 @@ export class HttpAgent implements Agent {
},
identity?: Identity | Promise<Identity>,
): Promise<SubmitResponse> {
const id = await(identity !== undefined ? await identity : await this.#identity);
const id = await (identity !== undefined ? await identity : await this.#identity);
if (!id) {
throw new IdentityInvalidError(
"This identity has expired due this application's security policy. Please refresh your authentication.",
Expand Down Expand Up @@ -696,7 +697,7 @@ export class HttpAgent implements Agent {
this.log.print(`ecid ${ecid.toString()}`);
this.log.print(`canisterId ${canisterId.toString()}`);
const makeQuery = async () => {
const id = await(identity !== undefined ? await identity : await this.#identity);
const id = await (identity !== undefined ? await identity : await this.#identity);
if (!id) {
throw new IdentityInvalidError(
"This identity has expired due this application's security policy. Please refresh your authentication.",
Expand Down Expand Up @@ -876,7 +877,7 @@ export class HttpAgent implements Agent {
identity?: Identity | Promise<Identity>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Promise<any> {
const id = await(identity !== undefined ? await identity : await this.#identity);
const id = await (identity !== undefined ? await identity : await this.#identity);
if (!id) {
throw new IdentityInvalidError(
"This identity has expired due this application's security policy. Please refresh your authentication.",
Expand Down

0 comments on commit ac655eb

Please sign in to comment.