From b3af8a21c3f781b02eea268e5bcda9ebcab21d93 Mon Sep 17 00:00:00 2001 From: Senyoret1 <34079003+Senyoret1@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:47:20 -0400 Subject: [PATCH] Fix for the skysocks UI --- .../skysocks-client-settings.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/skysocks-client-settings/skysocks-client-settings.component.ts b/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/skysocks-client-settings/skysocks-client-settings.component.ts index f1d4f01dd5..1c3fba9525 100644 --- a/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/skysocks-client-settings/skysocks-client-settings.component.ts +++ b/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/skysocks-client-settings/skysocks-client-settings.component.ts @@ -239,7 +239,7 @@ export class SkysocksClientSettingsComponent implements OnInit, OnDestroy { * If true, all the ways provided by default by the UI for closing the modal window are disabled. */ get disableDismiss(): boolean { - return this.button && this.settingsButton ? (this.button.isLoading || this.settingsButton.isLoading) : false; + return (this.button && this.button.isLoading) || (this.settingsButton && this.settingsButton.isLoading); } // Validates an IPv4 address. @@ -613,7 +613,9 @@ export class SkysocksClientSettingsComponent implements OnInit, OnDestroy { } this.button.showLoading(false); - this.settingsButton.showLoading(false); + if (this.settingsButton) { + this.settingsButton.showLoading(false); + } this.working = true; const data = { pk: publicKey }; @@ -674,13 +676,17 @@ export class SkysocksClientSettingsComponent implements OnInit, OnDestroy { // Allow to continue using the component. this.working = false; this.button.reset(false); - this.settingsButton.reset(false); + if (this.settingsButton) { + this.settingsButton.reset(false); + } } private onServerDataChangeError(err: OperationError) { this.working = false; this.button.showError(false); - this.settingsButton.reset(false); + if (this.settingsButton) { + this.settingsButton.reset(false); + } err = processServiceError(err); this.snackbarService.showError(err);