This commit is contained in:
Jiiks 2019-03-04 10:25:00 +02:00
parent 3661207602
commit 2a93e5d2a3
9 changed files with 22 additions and 17 deletions

View File

@ -126,6 +126,7 @@ export default class DiscordApi {
static get currentGuild() {
const guild = Modules.GuildStore.getGuild(Modules.SelectedGuildStore.getGuildId());
if (guild) return Guild.from(guild);
return null;
}
/**
@ -135,6 +136,7 @@ export default class DiscordApi {
static get currentChannel() {
const channel = Modules.ChannelStore.getChannel(Modules.SelectedChannelStore.getChannelId());
if (channel) return Channel.from(channel);
return null;
}
/**
@ -144,6 +146,7 @@ export default class DiscordApi {
static get currentUser() {
const user = Modules.UserStore.getCurrentUser();
if (user) return User.from(user);
return null;
}
/**

View File

@ -288,7 +288,7 @@ class Module {
if (this._require) return this._require;
const __webpack_require__ = this.getWebpackRequire();
if (!__webpack_require__) return;
if (!__webpack_require__) return null;
this.hookWebpackRequireCache(__webpack_require__);
return this._require = __webpack_require__;

View File

@ -272,7 +272,7 @@ class WebpackModules {
if (this._require) return this._require;
const __webpack_require__ = this.getWebpackRequire();
if (!__webpack_require__) return;
if (!__webpack_require__) return null;
this.hookWebpackRequireCache(__webpack_require__);
return this._require = __webpack_require__;

View File

@ -69,10 +69,11 @@ export default class Theme extends Content {
path: this.paths.mainPath.replace(/\\/g, '/')
});
// Why are these getters?
Logger.log(this.name, ['Finished compiling theme', new class Info {
get SCSS_variables() { console.log(config); }
get Compiled_SCSS() { console.log(result.css.toString()); }
get Result() { console.log(result); }
get SCSS_variables() { console.log(config); return ''; }
get Compiled_SCSS() { console.log(result.css.toString()); return ''; }
get Result() { console.log(result); return ''; }
}]);
return {

View File

@ -179,7 +179,7 @@ export class PermissionOverwrite {
}
get guild() {
if (this.channel) return this.channel.guild;
return this.channel ? this.channel.guild : null;
}
}
@ -187,7 +187,7 @@ export class RolePermissionOverwrite extends PermissionOverwrite {
get roleId() { return this.discordObject.id }
get role() {
if (this.guild) return this.guild.roles.find(r => r.id === this.roleId);
return this.guild ? this.guild.roles.find(r => r.id === this.roleId) : null;
}
}

View File

@ -166,14 +166,14 @@ export class Guild {
* The guild's AFK channel.
*/
get afkChannel() {
if (this.afkChannelId) return Channel.fromId(this.afkChannelId);
return this.afkChannelId ? Channel.fromId(this.afkChannelId) : null;
}
/**
* The channel system messages are sent to.
*/
get systemChannel() {
if (this.systemChannelId) return Channel.fromId(this.systemChannelId);
return this.systemChannelId ? Channel.fromId(this.systemChannelId) : null;
}
/**

View File

@ -42,11 +42,11 @@ export class Reaction {
}
get message() {
if (this.channel) return this.channel.messages.find(m => m.id === this.messageId);
return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null;
}
get guild() {
if (this.channel) return this.channel.guild;
return this.channel ? this.channel.guild : null;
}
}
@ -84,11 +84,11 @@ export class Embed {
}
get message() {
if (this.channel) return this.channel.messages.find(m => m.id === this.messageId);
return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null;
}
get guild() {
if (this.channel) return this.channel.guild;
return this.channel ? this.channel.guild : null;
}
}
@ -143,6 +143,7 @@ export class Message {
get author() {
if (this.discordObject.author && !this.webhookId) return User.from(this.discordObject.author);
return null;
}
get channel() {
@ -150,7 +151,7 @@ export class Message {
}
get guild() {
if (this.channel) return this.channel.guild;
return this.channel ? this.channel.guild : null;
}
/**
@ -202,7 +203,7 @@ export class DefaultMessage extends Message {
get application() { return this.discordObject.application }
get webhook() {
if (this.webhookId) return this.discordObject.author;
return this.webhookId ? this.discordObject.author : null;
}
get mentions() {

View File

@ -77,7 +77,7 @@ export class User {
get note() {
const note = Modules.UserNoteStore.getNote(this.id);
if (note) return note;
return note ? note : null;
}
/**

View File

@ -71,7 +71,7 @@ export default class {
get vueMount() {
const element = ReactDOM.findDOMNode(this);
if (!element) return;
if (!element) return null;
if (this.props.mountAtTop) return element;
if (element.firstChild) return element.firstChild;
const newElement = document.createElement('span');