Voice Disconnect refactor to use new builtin base
This commit is contained in:
parent
937ab55456
commit
e798e3d6e2
|
@ -13,21 +13,23 @@ import { Reflection } from 'modules';
|
||||||
|
|
||||||
export default new class VoiceDisconnect extends BuiltinModule {
|
export default new class VoiceDisconnect extends BuiltinModule {
|
||||||
|
|
||||||
get settingPath() {
|
/* Getters */
|
||||||
return ['core', 'default', 'voice-disconnect'];
|
get moduleName() { return 'VoiceDisconnect' }
|
||||||
}
|
|
||||||
|
get settingPath() { return ['core', 'default', 'voice-disconnect'] }
|
||||||
|
|
||||||
async enabled(e) {
|
async enabled(e) {
|
||||||
window.addEventListener('beforeunload', this.listener);
|
window.addEventListener('beforeunload', this.listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
listener() {
|
|
||||||
const { VoiceChannelActions } = Reflection.modules;
|
|
||||||
VoiceChannelActions.selectVoiceChannel(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
disabled(e) {
|
disabled(e) {
|
||||||
window.removeEventListener('beforeunload', this.listener);
|
window.removeEventListener('beforeunload', this.listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Methods */
|
||||||
|
listener() {
|
||||||
|
const { VoiceChannelActions } = Reflection.modules;
|
||||||
|
VoiceChannelActions.selectVoiceChannel(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue