From 3af48a81e285af4b52c9e835ef78c59386f14138 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 1 Jun 2021 23:16:36 +0200 Subject: [PATCH] web/admin: fix source type not always matching modelname Signed-off-by: Jens Langhammer --- web/src/pages/sources/oauth/OAuthSourceForm.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/pages/sources/oauth/OAuthSourceForm.ts b/web/src/pages/sources/oauth/OAuthSourceForm.ts index d7ece0fb6..135c999d4 100644 --- a/web/src/pages/sources/oauth/OAuthSourceForm.ts +++ b/web/src/pages/sources/oauth/OAuthSourceForm.ts @@ -199,8 +199,10 @@ export class OAuthSourceForm extends ModelForm { ${until(new SourcesApi(DEFAULT_CONFIG).sourcesOauthSourceTypesList().then(types => { return types.map(type => { let selected = this.instance?.providerType === type.slug; + const modelSlug = this.modelName?.replace("oauthsource", "").replace("-", ""); + const typeSlug = type.slug.replace("-", ""); if (!this.instance?.pk) { - if (this.modelName?.replace("oauthsource", "") === type.slug) { + if (modelSlug === typeSlug) { selected = true; } }