From 7bb3931f2cef13613408e6be6daeab880a62f063 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Thu, 13 Oct 2016 14:22:58 -0300 Subject: [PATCH] Properly set device name, and set undefined arguments to setConfig as null --- CHANGELOG.md | 2 ++ src/application.coffee | 2 +- src/utils.coffee | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84189757..2a11ffa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Properly set device name, and set undefined arguments to setConfig as null [Pablo] + # v2.6.2 * Updated knex to ~0.12.3 diff --git a/src/application.coffee b/src/application.coffee index 1ab9c98f..e0c45006 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -594,7 +594,7 @@ application.update = update = (force) -> .then ({ local, dependent }) -> proxyvisor.fetchAndSetTargetsForDependentApps(dependent, fetch, apiKey) .then -> - utils.setConfig('name', deviceName) if local.name != deviceName + utils.setConfig('name', local.name) if local.name != deviceName .then -> parseEnvAndFormatRemoteApps(local.apps, uuid, apiKey) .then (remoteApps) -> diff --git a/src/utils.coffee b/src/utils.coffee index bcbf4c86..146b3d7c 100644 --- a/src/utils.coffee +++ b/src/utils.coffee @@ -150,7 +150,7 @@ exports.getConfig = getConfig = (key) -> .then ([ conf ]) -> return conf?.value -exports.setConfig = (key, value) -> +exports.setConfig = (key, value = null) -> knex('config').update({ value }).where({ key }) .then (n) -> knex('config').insert({ key, value }) if n == 0