【问题标题】:How to hide webchat icon after user logout angular cognigy用户注销后如何隐藏网络聊天图标
【发布时间】:2021-12-20 16:57:57
【问题描述】:

我在用户登录后从 webChatService 调用 initWebchat,但我也想在用户注销后删除 webChatIcon,现在用户注销后 webChat 图标仍然显示这是我创建的服务

`声明 const initWebchat: any;

export class WebChatService {enter code here
  constructor(private readonly $sessionStorage: SessionStorageService) {}
  initWebchat() {
    initWebchat('https://endpoint-trial.cognigy.ai/xxxx', {
      sessionId: "'" + this.$sessionStorage.retrieve('sessionID') + "'",
      settings: {
        title: 'Test Title',
        inputPlaceholder: 'Please reply here',
        getStartedText: 'Hello Faii',
      },
    }).then((webchat) => {
      webchat.registerAnalyticsService((event) => {
   ....
}`    

【问题讨论】:

    标签: angular web-chat


    【解决方案1】:

    支持团队在此链接中向我发送了解决方案

    const rootWebChat = document.querySelector('.webchat-root') as HTMLElement;

    rootWebChat.style.display = 'none';

    https://codesandbox.io/s/local-persistent-history-forked-zyxqz?file=/index.html:904-922

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-15
      • 2019-04-10
      • 2014-10-20
      • 1970-01-01
      • 2016-05-27
      相关资源
      最近更新 更多