From 0dc3518793ca13b7e7ff8d9670be5ecb0774787b Mon Sep 17 00:00:00 2001 From: NguyenTranHoangSym <97150869+NguyenTranHoangSym@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:15:18 +0700 Subject: [PATCH] SDA-4430_4431: Adding final factor to fix About us (#2044) --- src/renderer/components/about-app.tsx | 43 ++++++--- src/renderer/styles/about-app.less | 125 +++++++++++++++----------- 2 files changed, 106 insertions(+), 62 deletions(-) diff --git a/src/renderer/components/about-app.tsx b/src/renderer/components/about-app.tsx index 768cfadf..0341de70 100644 --- a/src/renderer/components/about-app.tsx +++ b/src/renderer/components/about-app.tsx @@ -113,7 +113,6 @@ export default class AboutApp extends React.Component<{}, IState> { sdaVersion, sdaBuildNumber, client, - didUpdateHostname, isValidHostname, } = this.state; @@ -146,12 +145,17 @@ export default class AboutApp extends React.Component<{}, IState> { value: `${formattedSfeVersion} ${client}`, }, ]; - const closeButtonText = - isValidHostname && - didUpdateHostname && - !this.state.finalConfig.url.includes(this.state.updatedHostname ?? '') - ? i18n.t('Save and Restart', ABOUT_SYMPHONY_NAMESPACE)() - : i18n.t('Close', ABOUT_SYMPHONY_NAMESPACE)(); + const finalConfig = this.state.finalConfig?.url + ?.replace(/https:\/\//g, '') + ?.split('/')[0]; + const updatedHostname = this.state.updatedHostname + ?.replace(/https:\/\//g, '') + ?.split('/')[0]; + const isHostNamechanged = + finalConfig && updatedHostname && finalConfig !== updatedHostname; + const closeButtonText = isHostNamechanged + ? i18n.t('Save and Restart', ABOUT_SYMPHONY_NAMESPACE)() + : i18n.t('Close', ABOUT_SYMPHONY_NAMESPACE)(); const cancelText = i18n.t('Cancel', ABOUT_SYMPHONY_NAMESPACE)(); return ( @@ -192,7 +196,11 @@ export default class AboutApp extends React.Component<{}, IState> {
{this.state.isPodEditing && (