GithubHelp home page GithubHelp logo

Comments (5)

AndySteel-kcom avatar AndySteel-kcom commented on June 3, 2024 3

I used this technique, calling the following code immediately after the streams api has initialised.

    const w = window.open('', connect.MasterTopics.LOGIN_POPUP);
    if (w) {
      w.close();
    }

Works for me without side effects.

from amazon-connect-streams.

mschersten avatar mschersten commented on June 3, 2024

That works perfectly for me. Thanks!

from amazon-connect-streams.

AbdulQayyumaq avatar AbdulQayyumaq commented on June 3, 2024

@AndySteel-kcom Thank you.
I am a newbie can you please help me in it as where to use this code? you said right after the streams api has initialized. is it index.js or where?
@mschersten please guide as you have done..
Like this?

connect.core.initCCP(containerDiv,
{

 });
const w = window.open('', connect.MasterTopics.LOGIN_POPUP);
    if (w) {
      w.close();
    }

from amazon-connect-streams.

mschersten avatar mschersten commented on June 3, 2024

Hi @AbdulQayyumaq,

I'll give a brief explanation of how that worked, but I believe this has been replaced by a new configuration option.

In the old way, you would initialize Connect, and then subscribe to agent events, and then close the window in the agent event subscription:

connect.core.initCCP(containerDiv,{});
connect.agent(subscribeToAgentEvents);
function subscribeToAgentEvents(agent) {
    const w = window.open('', connect.MasterTopics.LOGIN_POPUP);
    if (w) {
      w.close();
    }
};

But now there is a method to autoClose, search the documentation for "autoclose" and you'll find options.loginOptions.autoclose, and options.loginPopupAutoClose. So I think you can just do

connect.core.initCCP(containerDiv, {
    loginPopupAutoClose: true, 
    loginOptions: {
      autoClose: true
    }
});

With all the other required options, of course.

from amazon-connect-streams.

AbdulQayyumaq avatar AbdulQayyumaq commented on June 3, 2024

Thank you. I have done it. yeah there is an option of autoClose but it doesn't working as login popup got open in a new window but couldn't get closed.
i have used this solution its working only in Chrome but not in Edge.

from amazon-connect-streams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.