This commit is contained in:
Samuel Elliott 2018-03-16 01:09:18 +00:00
parent 086b6253bc
commit 094ef7e173
2 changed files with 4 additions and 25 deletions

View File

@ -17,7 +17,7 @@ export default class GuildSetting extends Setting {
constructor(args, ...merge) {
super(args, ...merge);
this.args.guilds = this.value ? this.value.map(guild_id => DiscordApi.guilds.get({ id: guild_id })) : [];
this.args.guilds = this.value ? this.value.map(id => DiscordApi.guilds.get({ id })) : [];
}
/**
@ -56,12 +56,6 @@ export default class GuildSetting extends Setting {
*/
addGuild(guild_id) {
return this.setValue(this.value.concat([guild_id]));
// if (this.guilds.find(g => g && g.id === guild_id)) return;
// const guild = DiscordApi.guilds.get({ id: guild_id });
// this.guilds.push(guild);
// await this.emit('guild-added', guild);
// return await this.setValue(this.value.concat([guild_id]));
}
/**
@ -71,14 +65,6 @@ export default class GuildSetting extends Setting {
*/
removeGuild(guild_id) {
return this.setValue(this.value.filter(g => g !== guild_id));
// const guild = this.guilds.find(g => g && g.id === guild_id);
// const value = Utils.removeFromArray(this.value.slice(0), guild_id);
// if (guild) {
// Utils.filterArray(this.guilds, g => !g || g.id !== guild_id);
// await this.emit('guild-removed', guild);
// }
// return await this.setValue(value);
}
/**
@ -88,7 +74,7 @@ export default class GuildSetting extends Setting {
* @param {SettingUpdatedEvent} updatedSetting
*/
setValueHookSync(updatedSetting) {
this.args.guilds = updatedSetting.value ? updatedSetting.value.map(guild_id => DiscordApi.guilds.get({ id: guild_id })) : [];
this.args.guilds = updatedSetting.value ? updatedSetting.value.map(id => DiscordApi.guilds.get({ id })) : [];
}
/**
@ -134,9 +120,9 @@ export default class GuildSetting extends Setting {
/**
* Returns a representation of this setting's value in SCSS.
* @return {String|Promise}
* @return {String}
*/
async toSCSS() {
toSCSS() {
if (!this.value || !this.value.length) return '()';
const guilds = [];

View File

@ -1,10 +1,4 @@
.bd-form-guildinput {
}
.bd-guilds {
// margin: 15px 0;
.bd-guild {
$size: 36px;
@ -35,7 +29,6 @@
&.bd-guild-has-icon {
background-color: rgb(47, 49, 54);
// box-shadow: 0 0 1px #000000;
}
}