From 423fb144a0209c7acb74dc756faa37e19b7aa905 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 24 Aug 2021 15:58:13 -0400 Subject: some fixes and hacky fetch member work arround --- src/tasks/updateCache.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tasks') diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 7fb7eb3..69919d8 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -24,11 +24,13 @@ export class UpdateCacheTask extends BushTask { private static async updateGlobalCache(client: BushClient): Promise { const environment = config.environment; - const row = ((await Global.findByPk(environment)) ?? (await Global.create({ environment }))).toJSON(); + const row: { [x: string]: any } = ((await Global.findByPk(environment)) ?? (await Global.create({ environment }))).toJSON(); for (const option in row) { - if (Object.keys(client.cache.global).includes(option)) - client.cache.global[option as keyof typeof client.cache.global] = row[option as keyof typeof row]; + if (Object.keys(client.cache.global).includes(option)) { + client.cache.global[option as keyof typeof client.cache.global] = row[option]; + if (option === 'superUsers') client.superUserID = row[option]; + } } } -- cgit