Skip to content

Commit

Permalink
fix(web): unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Paniontko committed Aug 6, 2018
1 parent b7eba94 commit 832a3db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/channels/botpress-channel-web/src/db.js
Expand Up @@ -11,6 +11,10 @@ import { sanitizeUserId } from './util'
module.exports = (knex, config) => {
const RECENT_CONVERSATION_LIFETIME = ms(config.recentConversationLifetime)

const isLite = knex => {
return knex.client.config.client === 'sqlite3'
}

async function getUserInfo(userId) {
const user = await knex('users')
.where({ platform: 'webchat', userId: sanitizeUserId(userId) })
Expand Down Expand Up @@ -209,7 +213,7 @@ module.exports = (knex, config) => {
.orderBy('conversationId')
.orderBy('sent_on', 'desc')

if (process.env.DATABASE !== 'postgres') {
if (isLite(knex)) {
const lastMessagesDate = knex('web_messages')
.whereIn('conversationId', conversationIds)
.groupBy('conversationId')
Expand Down Expand Up @@ -297,6 +301,7 @@ module.exports = (knex, config) => {
patchConversation,
getConversation,
listConversations,
getOrCreateRecentConversation
getOrCreateRecentConversation,
isLite
}
}
Expand Up @@ -14,8 +14,6 @@ const DEFAULT_WELCOME_MESSAGE = `Hello!
It will be a pleasure to help you getting started.
`

const BOT_HOSTNAME = window.location.origin

export default class Convo extends React.Component {
constructor(props) {
super(props)
Expand Down

0 comments on commit 832a3db

Please sign in to comment.