Skip to content

Commit

Permalink
Destructured progress and total from notification params object
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome3o-anthropic committed Dec 16, 2024
1 parent 2a3cab2 commit 881a0ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export abstract class Protocol<
}

private _onprogress(notification: ProgressNotification): void {
const { progress, total, progressToken } = notification.params;
const { progressToken, ...params } = notification.params;
const handler = this._progressHandlers.get(Number(progressToken));
if (handler === undefined) {
this._onerror(
Expand All @@ -289,7 +289,7 @@ export abstract class Protocol<
return;
}

handler({ progress, total });
handler(params);
}

private _onresponse(response: JSONRPCResponse | JSONRPCError): void {
Expand Down

0 comments on commit 881a0ce

Please sign in to comment.