Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Rebased code and fixed API
Browse files Browse the repository at this point in the history
  • Loading branch information
knrt10 committed Aug 14, 2019
1 parent bbdbd24 commit b84e045
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 380 deletions.
7 changes: 4 additions & 3 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component } from 'preact';
import { Router, route } from 'preact-router';
import queryString from 'query-string';

import { Livechat } from '../../api';
import { locationUpdate, userSessionPresence } from '../../lib/location';
import history from '../../history';
import Chat from '../../routes/Chat';
Expand Down Expand Up @@ -137,7 +136,8 @@ export class App extends Component {

async initialize() {
// TODO: split these behaviors into composable components
await Connection.init();
await Connection.init();
locationUpdate();
this.handleTriggers();
CustomFields.init();
Hooks.init();
Expand All @@ -150,7 +150,8 @@ export class App extends Component {

async finalize() {
CustomFields.reset();
userPresence.reset();
userPresence.reset();
userSessionPresence.reset();
visibility.removeListener(this.handleVisibilityChange);
I18n.off('change', this.handleLanguageChange);
}
Expand Down
23 changes: 0 additions & 23 deletions src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const loadConfig = async () => {

Livechat.credentials.token = token;

<<<<<<< HEAD
const {
agent,
room,
Expand All @@ -35,28 +34,6 @@ export const loadConfig = async () => {
visible: true,
unread: null,
});
=======
const {
agent,
room,
guest: user,
resources: { sound: src = null } = {},
...config
} = await Livechat.config({ token });

await store.setState({
config,
agent,
room,
user,
sound: { src, enabled: true, play: false },
messages: [],
typing: [],
noMoreMessages: false,
visible: true,
unread: null,
});
>>>>>>> Rebased code
};

export const getToken = () => {
Expand Down
Loading

0 comments on commit b84e045

Please sign in to comment.