Skip to content

Commit

Permalink
chore: update for qa
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Aug 29, 2024
1 parent 5df34da commit 58c065d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ import ReactDOM from 'react-dom/client';

import App from './App';

const QA = () => {
const urlParams = new URLSearchParams(window.location.search);
const appId = urlParams.get('app_id') ?? import.meta.env.VITE_CHAT_WIDGET_APP_ID;
const botId = urlParams.get('bot_id') ?? import.meta.env.VITE_CHAT_WIDGET_BOT_ID;

if (!appId || !botId) {
return null;
}

return <App applicationId={appId} botId={botId} />;
};

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App applicationId={import.meta.env.VITE_CHAT_WIDGET_APP_ID} botId={import.meta.env.VITE_CHAT_WIDGET_BOT_ID} />
<QA />
</React.StrictMode>,
);

0 comments on commit 58c065d

Please sign in to comment.