summary refs log tree commit diff
path: root/src/connections/BattleNet
diff options
context:
space:
mode:
authorTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-07-06 06:47:14 +0200
committerTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-07-06 06:47:14 +0200
commitcd7641c2aebd245a59a189233fc5700a924639e0 (patch)
tree662441b1006e01ac48f8a32ff4da7f4ff923430f /src/connections/BattleNet
parentDon't embed links in <> (diff)
downloadserver-ts-cd7641c2aebd245a59a189233fc5700a924639e0.tar.xz
Fix loading connection settings
Diffstat (limited to 'src/connections/BattleNet')
-rw-r--r--src/connections/BattleNet/index.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/connections/BattleNet/index.ts b/src/connections/BattleNet/index.ts

index 4fdfccb16..8f44944cf 100644 --- a/src/connections/BattleNet/index.ts +++ b/src/connections/BattleNet/index.ts
@@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ @@ -47,13 +47,15 @@ export default class BattleNetConnection extends Connection { settings: BattleNetSettings = new BattleNetSettings(); init(): void { - const settings = - ConnectionLoader.getConnectionConfig<BattleNetSettings>( - this.id, - this.settings, - ); + this.settings = ConnectionLoader.getConnectionConfig<BattleNetSettings>( + this.id, + this.settings, + ); - if (settings.enabled && (!settings.clientId || !settings.clientSecret)) + if ( + this.settings.enabled && + (!this.settings.clientId || !this.settings.clientSecret) + ) throw new Error(`Invalid settings for connection ${this.id}`); }