diff --git a/apps/web/process/hooks/init/get-main-data.js b/apps/web/process/hooks/init/get-main-data.js index fcc734c..a7d3a9f 100644 --- a/apps/web/process/hooks/init/get-main-data.js +++ b/apps/web/process/hooks/init/get-main-data.js @@ -36,9 +36,14 @@ function getMainData({ query }, onCompleted, user) { query: CRMTypes.GetOpportunitiesDocument, variables: { domainname: user.domainName }, }).then(({ data }) => { - onCompleted({ - selectOpportunity: data?.opportunities, - }); + const systemuser = data?.systemusers?.[0]; + + if (systemuser) { + const { opportunities } = systemuser; + onCompleted({ + selectOpportunity: opportunities, + }); + } }); query({ query: CRMTypes.GetTransactionCurrenciesDocument }).then(({ data }) => {