summary refs log tree commit diff
path: root/src/connections/Twitter
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/Twitter
parentDon't embed links in <> (diff)
downloadserver-ts-cd7641c2aebd245a59a189233fc5700a924639e0.tar.xz
Fix loading connection settings
Diffstat (limited to 'src/connections/Twitter')
-rw-r--r--src/connections/Twitter/index.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/connections/Twitter/index.ts b/src/connections/Twitter/index.ts

index 62fd7da18..eba8ceb50 100644 --- a/src/connections/Twitter/index.ts +++ b/src/connections/Twitter/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/>. */ @@ -55,12 +55,15 @@ export default class TwitterConnection extends RefreshableConnection { settings: TwitterSettings = new TwitterSettings(); init(): void { - const settings = ConnectionLoader.getConnectionConfig<TwitterSettings>( + this.settings = ConnectionLoader.getConnectionConfig<TwitterSettings>( 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}`); }