How to use the botframework-webchat.ConnectionStatus.Online function in botframework-webchat

To help you get started, we’ve selected a few botframework-webchat examples, based on popular ways it is used in public projects.

github SharePoint / sp-dev-fx-extensions / samples / react-msal-bot / spfx / src / extensions / graphBot / components / GraphBot.tsx View on Github external
.subscribe((connectionStatus) => {
            switch (connectionStatus) {
                // Successfully connected to the converstaion.
                case ConnectionStatus.Online :
                    if (!conversationId) {
                        // Store the current conversation id in the browser session storage
                        // with 15 minutes expiration
                        this._storage.local.put(
                            this.CONVERSATION_ID_KEY, this._botConnection["conversationId"], 
                            Util.dateAdd(new Date(), "minute", 15)
                        );
                    }

                    break;
            }
        });
github microsoft / botbuilder-js / samples / echobot-es6-botframework-webchat / src / webChatAdapter.js View on Github external
constructor() {
        super();
        this.activity$ = new Subject();
        this.botConnection = {
            connectionStatus$: new BehaviorSubject(ConnectionStatus.Online),
            activity$: this.activity$.share(),
            end() {
                debugger
            },
            postActivity: activity => {
                const id = Date.now().toString();
                return Observable.fromPromise(this
                    .onReceive(Object.assign({}, activity, {
                        id,
                        conversation: { id: 'bot' },
                        channelId: 'WebChat'
                    }))
                    .then(() => id)
                )
            }
        }