From 982d71f81f00495b9aed518da1b7bdfb4e50010f Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 21 Jun 2021 16:11:14 -0400 Subject: fix(*): eslint --- src/tasks/updateCache.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/tasks/updateCache.ts') diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 5994af9..6c1f098 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -10,19 +10,18 @@ export default class UpdateCacheTask extends BushTask { } async exec(): Promise { const environment = this.client.config.dev ? 'development' : 'production'; - let row = await Global.findByPk(environment); - if (!row) { - row = await Global.create({ + const row = + (await Global.findByPk(environment)) || + (await Global.create({ environment, superUsers: [], blacklistedChannels: [], blacklistedGuilds: [], blacklistedUsers: [], disabledCommands: [] - }); - } + })); - for (let option in row) { + for (const option in row) { if (this.client.cache[option]) this.client.cache[option] = row[option]; } this.client.logger.verbose(`UpdateCache`, `Updated cache.`); -- cgit