feat: Add an SDK method for opening conversation in popout window (#4232)
This commit is contained in:
parent
0ba6e772a4
commit
30ac8054ba
4 changed files with 45 additions and 11 deletions
26
app/javascript/widget/helpers/popoutHelper.js
Normal file
26
app/javascript/widget/helpers/popoutHelper.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { buildPopoutURL } from './urlParamsHelper';
|
||||
|
||||
export const popoutChatWindow = (
|
||||
origin,
|
||||
websiteToken,
|
||||
locale,
|
||||
conversationCookie
|
||||
) => {
|
||||
try {
|
||||
const windowUrl = buildPopoutURL({
|
||||
origin,
|
||||
websiteToken,
|
||||
locale,
|
||||
conversationCookie,
|
||||
});
|
||||
const popoutWindow = window.open(
|
||||
windowUrl,
|
||||
`webwidget_session_${websiteToken}`,
|
||||
'resizable=off,width=400,height=600'
|
||||
);
|
||||
popoutWindow.focus();
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(err);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue