Skip to content

Commit

Permalink
fix(condo): close #5464 no more useless warnings (#5468)
Browse files Browse the repository at this point in the history
  • Loading branch information
pahaz authored Nov 11, 2024
1 parent 2fb65fc commit b4ef6db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/condo/domains/common/components/UseDeskWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ const UseDeskWidget: React.FC = () => {
const userIdentify = useMemo(() => get(messenger, 'userIdentify', null), [messenger])

useEffect(() => {
if (!UseDeskWidgetId) return

const userId = get(user, 'id')

try {
if (UseDeskWidgetId && isFunction(userIdentify) && typeof window !== 'undefined') {
if (isFunction(userIdentify) && typeof window !== 'undefined') {
const name = get(link, 'name')
const email = get(user, 'email')
const phone = get(user, 'phone')
Expand Down Expand Up @@ -74,7 +76,7 @@ const UseDeskWidget: React.FC = () => {
})
}

messenger.setAdditionalFields([
if (messenger) messenger.setAdditionalFields([
{
id: useDeskFieldsIdsMap.tin, value: get(link, ['organization', 'tin'], null),
},
Expand Down
4 changes: 2 additions & 2 deletions apps/condo/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ const MyApp = ({ Component, pageProps }) => {
useHotCodeReload()
dayjs.locale(intl.locale)
const router = useRouter()
const { publicRuntimeConfig: { yandexMetrikaID, popupSmartConfig } } = getConfig()
const { publicRuntimeConfig: { yandexMetrikaID, popupSmartConfig, UseDeskWidgetId } } = getConfig()

const LayoutComponent = Component.container || BaseLayout
// TODO(Dimitreee): remove this mess later
Expand Down Expand Up @@ -520,9 +520,9 @@ const MyApp = ({ Component, pageProps }) => {
</LayoutContextProvider>
{yandexMetrikaID && <YandexMetrika />}
{!isEmpty(popupSmartConfig) && <PopupSmart />}
{UseDeskWidgetId && <UseDeskWidget/>}
</CacheProvider>
</ConfigProvider>
<UseDeskWidget/>
</>
)
}
Expand Down

0 comments on commit b4ef6db

Please sign in to comment.