Voice Disconnect refactor to use new builtin base

This commit is contained in:
Jiiks 2018-08-25 16:59:24 +03:00
parent 937ab55456
commit e798e3d6e2
1 changed files with 10 additions and 8 deletions

View File

@ -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);
}
} }