update remaining code for versioned config

This commit is contained in:
Josh Harvey 2016-12-09 11:36:29 +02:00
parent 2c6177bff9
commit e6cd0d9473
6 changed files with 25 additions and 20 deletions

View file

@ -4,6 +4,7 @@ const path = require('path')
const options = require('../options')
const db = require('../db')
const config = require('./config')
const accountRoot = options.pluginPath
const schemas = {}
@ -37,8 +38,7 @@ function selectedAccounts () {
v.fieldValue.value
const mapSchema = code => schemas[code]
return db.oneOrNone('select data from user_config where type=$1', ['config'])
.then(row => row && row.data)
return config.fetchConfig()
.then(data => {
if (!data) return []