Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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;
}
});
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)
)
}
}