2020-07-16 07:42:56 +02:00
|
|
|
import Builtin from "../../structs/builtin";
|
2019-05-31 07:53:11 +02:00
|
|
|
import {DiscordModules} from "modules";
|
|
|
|
|
|
|
|
export default new class DarkMode extends Builtin {
|
|
|
|
get name() {return "VoiceDisconnect";}
|
2019-06-06 06:28:43 +02:00
|
|
|
get category() {return "general";}
|
|
|
|
get id() {return "voiceDisconnect";}
|
2019-05-31 07:53:11 +02:00
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.beforeUnload = this.beforeUnload.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
enabled() {
|
|
|
|
window.addEventListener("beforeunload", this.beforeUnload);
|
|
|
|
}
|
|
|
|
|
|
|
|
disabled() {
|
|
|
|
window.removeEventListener("beforeunload", this.beforeUnload);
|
|
|
|
}
|
|
|
|
|
|
|
|
beforeUnload() {
|
|
|
|
DiscordModules.ChannelActions.selectVoiceChannel(null, null);
|
|
|
|
}
|
|
|
|
};
|