Skip to content

Customer profile is not loaded on page load #19

@furiousteabag

Description

@furiousteabag

Hey guys!

I am using an example of agent-app-sdk with the latest version of SDK (1.6.4) for retrieving the currently opened chat. It works when I change the current chat, but it does not load the current chat when I've just opened an app. So in order to set a customer profile agent have to click on some chat even when he has a chat opened.

To be precise, I have the following component:

import React, { Component, useEffect } from "react"
import { createDetailsWidget } from "@livechat/agent-app-sdk"

const MainForm = () => {
    useEffect(() => {
        createDetailsWidget().then((widget) => {
            widget.on("customer_profile", (profile) => {
                console.log("Customer profile: ", profile)
            })
        })
    }, [])
    return (
        <div>
            <h1>hello</h1>
        </div>
    )
}

I expect it to print customer profiles in 2 situations:

  1. When the agent changes the selected chat: it works perfectly
  2. When component loads and chat is already selected: this does not work

Here is the screencast of this in action:

agent-app-sdk-bug-showcase.mov

If you need some other info let me know!
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions