Skip to content

Commit

Permalink
Merge pull request #16 from eduzz/fix-code-smell
Browse files Browse the repository at this point in the history
corrige formatação
  • Loading branch information
DouglasZu authored Sep 30, 2024
2 parents 8d31341 + eb2999f commit 1833084
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
34 changes: 16 additions & 18 deletions Topbar/HyperflowSupportChat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,23 @@ const HyperflowSupportChat: React.FC<SupportChatProps> = ({ getJwtPromise, curre
}

Hyperflow.init(chatToken).on('getStarted', async () => {

try {
const jwt = await getJwtPromise;
const params: HyperflowParams = {
id: currentUser.id,
name: currentUser.name.split(' ')[0],
email: currentUser.email,
sender: jwt,
origin: hyperflowConfig.origin
};

if (currentUser?.isAccessPolicy) {
params.original_id = currentUser?.originalUserId;
params.original_name = currentUser?.originalUserName?.split(' ')[0];
params.original_email = currentUser?.originalUserEmail;
}

Hyperflow.initFlow(hyperflowConfig.flowId, params);

const jwt = await getJwtPromise;
const params: HyperflowParams = {
id: currentUser.id,
name: currentUser.name.split(' ')[0],
email: currentUser.email,
sender: jwt,
origin: hyperflowConfig.origin
};

if (currentUser?.isAccessPolicy) {
params.original_id = currentUser?.originalUserId;
params.original_name = currentUser?.originalUserName?.split(' ')[0];
params.original_email = currentUser?.originalUserEmail;
}

Hyperflow.initFlow(hyperflowConfig.flowId, params);
} catch {
console.error('Error getting JWT');
}
Expand Down
2 changes: 1 addition & 1 deletion _dev/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function App() {
flowId: 'bla',
origin: 'blinket'
}}
getJwtPromise= {Promise.resolve('')}
getJwtPromise={Promise.resolve('')}
/>

<Topbar.Search onEnter={onSearchEnter} />
Expand Down

0 comments on commit 1833084

Please sign in to comment.