diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts index 426d618aa..e10d7d75c 100644 --- a/web/src/admin/applications/ApplicationForm.ts +++ b/web/src/admin/applications/ApplicationForm.ts @@ -27,10 +27,12 @@ import { @customElement("ak-application-form") export class ApplicationForm extends ModelForm { - loadInstance(pk: string): Promise { - return new CoreApi(DEFAULT_CONFIG).coreApplicationsRetrieve({ + async loadInstance(pk: string): Promise { + const app = await new CoreApi(DEFAULT_CONFIG).coreApplicationsRetrieve({ slug: pk, }); + this.clearIcon = false; + return app; } @property({ attribute: false }) diff --git a/web/src/admin/flows/FlowForm.ts b/web/src/admin/flows/FlowForm.ts index bd56e4fb4..4d626b2b6 100644 --- a/web/src/admin/flows/FlowForm.ts +++ b/web/src/admin/flows/FlowForm.ts @@ -26,10 +26,12 @@ import { @customElement("ak-flow-form") export class FlowForm extends ModelForm { - loadInstance(pk: string): Promise { - return new FlowsApi(DEFAULT_CONFIG).flowsInstancesRetrieve({ + async loadInstance(pk: string): Promise { + const flow = await new FlowsApi(DEFAULT_CONFIG).flowsInstancesRetrieve({ slug: pk, }); + this.clearBackground = false; + return flow; } getSuccessMessage(): string { diff --git a/web/src/admin/sources/oauth/OAuthSourceForm.ts b/web/src/admin/sources/oauth/OAuthSourceForm.ts index 4076d4c23..a7f9c5e02 100644 --- a/web/src/admin/sources/oauth/OAuthSourceForm.ts +++ b/web/src/admin/sources/oauth/OAuthSourceForm.ts @@ -31,15 +31,13 @@ import { @customElement("ak-source-oauth-form") export class OAuthSourceForm extends ModelForm { - loadInstance(pk: string): Promise { - return new SourcesApi(DEFAULT_CONFIG) - .sourcesOauthRetrieve({ - slug: pk, - }) - .then((source) => { - this.providerType = source.type; - return source; - }); + async loadInstance(pk: string): Promise { + const source = await new SourcesApi(DEFAULT_CONFIG).sourcesOauthRetrieve({ + slug: pk, + }); + this.providerType = source.type; + this.clearIcon = false; + return source; } _modelName?: string; diff --git a/web/src/admin/sources/plex/PlexSourceForm.ts b/web/src/admin/sources/plex/PlexSourceForm.ts index 9fd26443e..51c78fb0e 100644 --- a/web/src/admin/sources/plex/PlexSourceForm.ts +++ b/web/src/admin/sources/plex/PlexSourceForm.ts @@ -28,16 +28,14 @@ import { @customElement("ak-source-plex-form") export class PlexSourceForm extends ModelForm { - loadInstance(pk: string): Promise { - return new SourcesApi(DEFAULT_CONFIG) - .sourcesPlexRetrieve({ - slug: pk, - }) - .then((source) => { - this.plexToken = source.plexToken; - this.loadServers(); - return source; - }); + async loadInstance(pk: string): Promise { + const source = await new SourcesApi(DEFAULT_CONFIG).sourcesPlexRetrieve({ + slug: pk, + }); + this.plexToken = source.plexToken; + this.loadServers(); + this.clearIcon = false; + return source; } @state() diff --git a/web/src/admin/sources/saml/SAMLSourceForm.ts b/web/src/admin/sources/saml/SAMLSourceForm.ts index f4db22596..87a4e20b2 100644 --- a/web/src/admin/sources/saml/SAMLSourceForm.ts +++ b/web/src/admin/sources/saml/SAMLSourceForm.ts @@ -38,10 +38,12 @@ export class SAMLSourceForm extends ModelForm { @state() clearIcon = false; - loadInstance(pk: string): Promise { - return new SourcesApi(DEFAULT_CONFIG).sourcesSamlRetrieve({ + async loadInstance(pk: string): Promise { + const source = await new SourcesApi(DEFAULT_CONFIG).sourcesSamlRetrieve({ slug: pk, }); + this.clearIcon = false; + return source; } getSuccessMessage(): string {