Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowLp174 committed Sep 25, 2022
1 parent d1ef475 commit 918f0a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Revoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ class VoiceConnection {
}
if (!(signaling.roomEmpty && this.leaveTimeout)) return;
this.leaving = setTimeout(() => {
this.leave();
this.once("leave", () => {
this.destroy();
this.emit("autoleave");
});
this.leave();
}, this.leaveTimeout * 1000);
}
initTransports(data) {
Expand Down Expand Up @@ -139,9 +140,10 @@ class VoiceConnection {
return new Promise((res) => {
this.signaling.disconnect();
this.closeTransport().then(() => {
this.device = Revoice.createDevice();
res();
// just a temporary fix till vortex rewrite
});
this.device = Revoice.createDevice();
res();
});
}
destroy() {
Expand Down Expand Up @@ -256,6 +258,9 @@ class Revoice {
device: device,
leaveOnEmpty: leaveIfEmpty
});
connection.on("autoleave", () => {
this.connections.delete(channelId);
});
connection.updateState(Revoice.State.JOINING);
this.connections.set(channelId, connection);
res(connection);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "revoice.js",
"version": "0.1.732",
"version": "0.1.733",
"description": "A voice module for Revolt",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 918f0a7

Please sign in to comment.