Skip to content

Commit

Permalink
fix(ws): implement a callback for deeplink events (#128)
Browse files Browse the repository at this point in the history
* fix: implement a callback for deeplinks

this is so discord web doesnt wait forever after emitting the event

* emit the full args so clients can access the type

* pass error

This seems to have no difference compared to not sending a callback.  Web will continue waiting for a non ERROR response
  • Loading branch information
Covkie authored Jan 15, 2025
1 parent 5aadc30 commit 18ce809
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export default class RPCServer extends EventEmitter {
break;

case 'DEEP_LINK':
this.emit('link', args.params);
const deep_callback = (success) => {
socket.send({ cmd, data: null, evt: success ? null : 'ERROR', nonce });
}
this.emit('link', args, deep_callback);
break;
}
}
Expand Down

0 comments on commit 18ce809

Please sign in to comment.